zoomMode property

ZoomMode zoomMode
final

By default, both the x and y-axes in the chart can be zoomed.

It can be changed by setting value to this property.

Defaults to ZoomMode.xy.

Also refer ZoomMode.

late ZoomPanBehavior zoomPanBehavior;

void initState() {
  zoomPanBehavior = ZoomPanBehavior(
    zoomMode: ZoomMode.x
  );
  super.initState();
}

Widget build(BuildContext context) {
  return SfCartesianChart(
    zoomPanBehavior: zoomPanBehavior
  );
}

Implementation

final ZoomMode zoomMode;