onPointTap property

ChartPointInteractionCallback? onPointTap
finalinherited

Called when tapped on the chart data point.

The user can fetch the series index, point index, view port index and data of the tapped data point.

Widget build(BuildContext context) {
   ChartSeriesController _chartSeriesController;
   return Container(
       child: SfCartesianChart(
           series: <LineSeries<SalesData, num>>[
               LineSeries<SalesData, num>(
                   onPointTap: (ChartPointDetails details) {
                      print(details.pointIndex);
                   },
               ),
           ],
       )
  );
}

Implementation

final ChartPointInteractionCallback? onPointTap;