onCrosshairPositionChanging property

ChartCrosshairCallback? onCrosshairPositionChanging
final

Occurs when tapping the axis label. Here, you can get the appropriate axis that is tapped and the axis label text.

CrosshairBehavior _crosshairBehavior;

@override
void initState() {
 _crosshairBehavior = CrosshairBehavior(enable: true);
 super.initState();
}

Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
           crosshairBehavior: crosshairBehavior,
           onCrosshairPositionChanging: (CrosshairRenderArgs args) => crosshair(args)
       )
   );
}
void crosshair(CrosshairRenderArgs args) {
   args.text = 'crosshair';
}

Implementation

final ChartCrosshairCallback? onCrosshairPositionChanging;