onPointLongPress property Null safety

ChartPointInteractionCallback? onPointLongPress
final

Called when long pressed on the chart data point.

The user can fetch the series index, point index, viewport point index and data of the long-pressed data point.

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

Implementation

final ChartPointInteractionCallback? onPointLongPress;