zoomByFactor method Null safety

void zoomByFactor(
  1. double zoomFactor
)

Changes the zoom level using zoom factor.

Here, you can pass the zoom factor of an axis to magnify the plot area. The value ranges from 0 to 1.

Implementation

void zoomByFactor(double zoomFactor) {
  _stateProperties.canSetRangeController = true;
  final SfCartesianChart chart = _stateProperties.chart;
  ChartAxisRendererDetails axisDetails;
  for (int index = 0;
      index < _stateProperties.chartAxis.axisRenderersCollection.length;
      index++) {
    axisDetails = AxisHelper.getAxisRendererDetails(
        _stateProperties.chartAxis.axisRenderersCollection[index]);
    axisDetails.zoomFactor = zoomFactor;
    if (chart.onZooming != null) {
      bindZoomEvent(chart, axisDetails, chart.onZooming!);
    }
    _stateProperties.zoomPanBehaviorRenderer._zoomingBehaviorDetails
        .createZoomState();
  }
}