onZoomStart property

ChartZoomingCallback? onZoomStart

Occurs when zooming action begins. You can customize the zoom factor and zoom position of an axis. Here, you can get the axis, current zoom factor, current zoom position, previous zoom factor, and previous zoom position.

ZoomPanBehavior _zoomPanBehavior;

void initState() {
 _zoomPanBehavior = ZoomPanBehavior(enableSelectionZooming: true);

Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
           zoomPanBehavior: _zoomPanBehavior,
           onZoomStart: (ZoomPanArgs args) => zoom(args),
void zoom(ZoomPanArgs args) {
   args.currentZoomFactor = 0.2;


final ChartZoomingCallback? onZoomStart;