LegendRenderer class

Renderer for chart legends.

Displays legend items with markers and labels, supporting multiple layouts and interactive toggling.

Implemented types
Mixed-in types

Constructors

LegendRenderer({required LegendConfig config, required List<LegendItem> items, void onItemTap(int index)?, TextCache? textCache})

Properties

config LegendConfig
Configuration for this renderer.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
items List<LegendItem>
getter/setter pair
needsRepaint bool
no setterinherited
onItemTap → void Function(int index)?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

calculateInsets(Size availableSize) EdgeInsets
Calculates the insets required by this renderer.
override
dispose() → void
Releases any cached resources.
override
hitTest(Offset point, Rect chartArea) RendererHitResult
Performs hit testing at the given point.
override
markNeedsRepaint() → void
inherited
markPainted() → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
render(Canvas canvas, Size size, Rect chartArea) → void
Renders the component to the canvas.
override
toString() String
A string representation of this object.
inherited
update(LegendConfig newConfig) → void
Updates the renderer configuration.
override
updateItems(List<LegendItem> newItems) → void
Updates the legend items.

Operators

operator ==(Object other) bool
The equality operator.
inherited