DataLabelSettings class

Customizes the data label.

Data labels can be added to a chart series by enabling the isVisible option in the dataLabelSettings. It has options to customize the appearance of the data label.

Provide options like color, border width, border color, alignment and data label text style for customization.

Constructors

DataLabelSettings({ChartAlignment alignment = ChartAlignment.center, Color? color, TextStyle textStyle = const TextStyle(fontFamily: 'Roboto', fontStyle: FontStyle.normal, fontWeight: FontWeight.normal, fontSize: 12), EdgeInsets margin = const EdgeInsets.fromLTRB(5, 5, 5, 5), double opacity = 1, ChartDataLabelAlignment labelAlignment = ChartDataLabelAlignment.auto, double borderRadius = 5, bool isVisible = false, int angle = 0, ChartWidgetBuilder? builder, bool useSeriesColor = false, Offset? offset, bool showCumulativeValues = false, bool showZeroValue = true, Color borderColor = Colors.transparent, double borderWidth = 0, LabelIntersectAction labelIntersectAction = LabelIntersectAction.hide, ConnectorLineSettings connectorLineSettings = const ConnectorLineSettings(), ChartDataLabelPosition labelPosition = ChartDataLabelPosition.inside})
Creating an argument constructor of DataLabelSettings class.

Properties

alignment ChartAlignment
Alignment of the data label.
final
angle int
Rotation angle of the data label.
final
borderColor Color
Border color of the data label.
final
borderRadius double
Customizes the data label border radius.
final
borderWidth double
Border width of the data label.
final
builder ChartWidgetBuilder?
Builder for data label.
final
color Color?
Color of the data label.
final
connectorLineSettings ConnectorLineSettings
Customizes the connector lines. Connector line is rendered when the data label is placed outside the chart.
final
hashCode int
The hash code for this object.
no setterinherited
isVisible bool
Toggles the visibility of the data label in the series.
final
labelAlignment ChartDataLabelAlignment
Position of the data label.
final
labelIntersectAction LabelIntersectAction
Action on data labels intersection.
final
labelPosition ChartDataLabelPosition
Position of the data label.
final
margin EdgeInsets
Margin between the data label text and its shape.
final
offset Offset?
Moves the data label vertically or horizontally from its position.
final
opacity double
Opacity of the data label.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showCumulativeValues bool
To show the cummulative values in stacked type series charts.
final
showZeroValue bool
Hides the data label and its connector line, if the data point value is 0 (Zero).
final
textStyle TextStyle
Customizes the data label font.
final
useSeriesColor bool
Uses the series color for filling the data label shape
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.
inherited