onDataLabelTapped property

DataLabelTapCallback? onDataLabelTapped
final

Called when the data label is tapped.

Whenever the data label is tapped, onDataLabelTapped callback will be called. Provides options to get the position of the data label, series index, point index and its text.

Note: This callback will not be called, when the builder is specified for data label (data label template). For this case, custom widget specified in the DataLabelSettings.builder property can be wrapped using the GestureDetector and this functionality can be achieved in the application level.

Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
           onDataLabelTapped: (DataLabelTapDetails args) {
                print(arg.seriesIndex);
                 }
       )
   );
}

Implementation

final DataLabelTapCallback? onDataLabelTapped;