dataLabelMapper property

  1. @override
ChartIndexedValueMapper<String>? dataLabelMapper
final

Maps the field name, which will be considered as a text for the data points.

Defaults to null.

Widget build(BuildContext context) {
   return Container(
       child: SfCircularChart(
           series: <PieSeries<ChartData, String>>[
             PieSeries<ChartData, String>(
               dataSource: <ChartData>[
                  ChartData('USA', 10),
                  ChartData('China', 11),
                  ChartData('Russia', 9),
                  ChartData('Germany', 10),
               ],
               xValueMapper: (ChartData data, _) => data.xVal,
               yValueMapper: (ChartData data, _) => data.yVal,
               dataLabelMapper: (ChartData data, _) => data.xVal,
             ),
            ],
       )
   );
}
class ChartData {
  ChartData(this.xVal, this.yVal);
  final String xVal;
  final int yVal;
}

Implementation

@override
final ChartIndexedValueMapper<String>? dataLabelMapper;