enableDirectionalZooming property

bool enableDirectionalZooming
final

Enables or disables directional zooming

Enables directional zooming behavior in the chart. When it set to true, users can zoom in a specific direction (horizontal, vertical, or diagonal) based on the angle of their pinch or drag gesture. This provides precise control over zooming, especially in scenarios with dense or complex data.

Directional zooming is effective only when both enableDirectionalZooming and enablePinching are set to true.

Directional zooming is designed specifically for finger interactions (touch gestures). It is not effective for mouse or trackpad-based interactions.

Defaults to false.

late ZoomPanBehavior zoomPanBehavior;

void initState() {
  zoomPanBehavior = ZoomPanBehavior(
    enableDirectionalZooming: true,
    zoomMode: ZoomMode.xy
    enablePinching: true,
  );
  super.initState();
}

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

Implementation

final bool enableDirectionalZooming;