reset method

void reset()

Returns the plot area back to its original position after zooming.

Implementation

void reset() {
  final RenderBehaviorArea? parent = parentBox as RenderBehaviorArea?;
  if (parent == null) {
    return;
  }

  parent.hideInteractiveTooltip();
  final RenderCartesianAxes? cartesianAxes = parent.cartesianAxes;
  if (cartesianAxes == null) {
    return;
  }

  cartesianAxes.visitChildren((RenderObject child) {
    if (child is RenderChartAxis) {
      child.controller.zoomFactor = 1.0;
      child.controller.zoomPosition = 0.0;
      if (parent.onZoomReset != null) {
        _bindZoomEvent(child, parent.onZoomReset!);
      }
    }
  });
}