Legend class

Identify the series in chart.

Legend contains list of chart series/data points in chart. It helps to identify the corresponding data series in chart. The name property of SfCartesianChart is used to define the label for the corresponding series legend item and for SfCircularChart type chart by default values mapped with xValueMapper will be displayed.

Provides options such as isVisible, borderWidth, alignment, opacity, borderColor, padding and so on to customize the appearance of the legend.

Annotations

Constructors

Legend({bool? isVisible, LegendPosition? position, ChartAlignment? alignment, Color? backgroundColor, Color? borderColor, double? borderWidth, double? opacity, String? height, String? width, double? padding, double? iconHeight, double? iconWidth, bool? shouldAlwaysShowScrollbar, bool? toggleSeriesVisibility, TextStyle? textStyle, bool? isResponsive, LegendItemOrientation? orientation, LegendTitle? title, LegendItemOverflowMode? overflowMode, LegendItemBuilder? legendItemBuilder, Color? iconBorderColor, double? iconBorderWidth, double? itemPadding, Offset? offset, ImageProvider<Object>? image})
Creating an argument constructor of Legend class.

Properties

alignment ChartAlignment
Alignment of the legend.
final
backgroundColor Color?
Background color of the legend.
final
borderColor Color
Border color of the legend.
final
borderWidth double
Border width of the legend.
final
hashCode int
The hash code for this object.
no setteroverride
height String?
The height of the legend.
final
iconBorderColor Color
Border color of the icon in the legend items.
final
iconBorderWidth double
Border width of the icon in the legend items.
final
iconHeight double
Height of the icon in legend item.
final
iconWidth double
Width of the icon in legend item.
final
image ImageProvider<Object>?
Used to add image to the legend icon.
final
isResponsive bool
Toggles the visibility of the legend.
final
isVisible bool?
Toggles the visibility of the legend.
final
itemPadding double
Padding of the legend items.
final
legendItemBuilder LegendItemBuilder?
Widget builder for legend items.
final
offset Offset?
Places the legend in custom position.
final
opacity double
Opacity of the legend.
final
orientation LegendItemOrientation
Orientation of the legend.
final
overflowMode LegendItemOverflowMode
Overflow legend items.
final
padding double
Padding between the legend items.
final
position LegendPosition
Position of the legend.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldAlwaysShowScrollbar bool
Toggles the scrollbar visibility.
final
textStyle TextStyle
Customizes the legend item text.
final
title LegendTitle
Customizes the legend title.
final
toggleSeriesVisibility bool
Toggles the series visibility.
final
width String?
The width of the legend.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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