onZooming property

ChartZoomingCallback? onZooming
final

Occurs when Zooming event is performed. Here, you can get the axis, current zoom factor, current zoom position, previous zoom factor, and previous zoom position.

ZoomPanBehavior _zoomPanBehavior;

@override
void initState() {
 _zoomPanBehavior = ZoomPanBehavior(enableSelectionZooming: true);
 super.initState();
}

Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
           zoomPanBehavior: _zoomPanBehavior,
           onZooming: (ZoomPanArgs args) => zoom(args),
       )
   );
}
void zoom(ZoomPanArgs args) {
   print(args.currentZoomPosition);
}

Implementation

final ChartZoomingCallback? onZooming;