legendItemText property

  1. @override
String? legendItemText
final

Text to be displayed in legend.

By default, the series name will be displayed in the legend. You can change this by setting values to this property.

Defaults to ‘’.

Widget build(BuildContext context) {
  return SfCartesianChart(
    legend: Legend(isVisible:true),
    series: <LineSeries<SalesData, String>>[
      LineSeries<SalesData, String>(
        legendItemText: 'Legend'
      ),
    ],
  );
}

Implementation

@override
final String? legendItemText;