onSelectionChanged property

ChartSelectionCallback? onSelectionChanged
final

Occurs while selection changes. Here, you can get the series, selected color, unselected color, selected border color, unselected border color, selected border width, unselected border width, series index, and point index.

Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
           onSelectionChanged: (SelectionArgs args) => print(args.selectedColor),
       ));
}

Implementation

final ChartSelectionCallback? onSelectionChanged;