sortFieldValueMapper property

  1. @override
ChartIndexedValueMapper? sortFieldValueMapper
final

Field in the data source for performing sorting. Sorting will be performed based on this field.

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),
               ],
               sortFieldValueMapper: (ChartData data, _) => data.xVal,
             ),
            ],
       ));
}
class ChartData {
  ChartData(this.xVal, this.yVal, [this.radius]);
  final String xVal;
  final int yVal;
  final String radius;
}

Implementation

@override
final ChartIndexedValueMapper<dynamic>? sortFieldValueMapper;