labelDisplayMode property
Enables the data labels.
Data labels are used to provide information about the exact point location and its value.
- SparkChartLabelDisplayMode.all enables the data label for all the data points.
- SparkChartLabelDisplayMode.none disables the data labels.
- SparkChartLabelDisplayMode.high displays the data label on highest data point.
- SparkChartLabelDisplayMode.low displays the data label on lowest data point.
- SparkChartLabelDisplayMode.first displays the data label on first data point.
- SparkChartLabelDisplayMode.last displays the data label on last data point.
Also refer SparkChartLabelDisplayMode.
Defaults to SparkChartDislayMode.none
.
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: SfSparkLineChart(
labelDisplayMode: SparkChartLabelDisplayMode.high,
data: <double>[18, 24, 30, 14, 28],
)),
);
}
Implementation
final SparkChartLabelDisplayMode? labelDisplayMode;