zoomIn method
void
zoomIn()
Increases the magnification of the plot area.
Implementation
void zoomIn() {
_chartState!._canSetRangeController = true;
final SfCartesianChartState chartState = _chartState!;
final SfCartesianChart chart = chartState._chart;
final ZoomPanBehaviorRenderer zoomPanBehaviorRenderer =
chartState._zoomPanBehaviorRenderer;
zoomPanBehaviorRenderer._isZoomIn = true;
zoomPanBehaviorRenderer._isZoomOut = false;
final double? zoomFactor = zoomPanBehaviorRenderer._zoomFactor;
chartState._zoomProgress = true;
ChartAxisRenderer axisRenderer;
bool? needZoom;
for (int index = 0;
index < chartState._chartAxis._axisRenderersCollection.length;
index++) {
axisRenderer = chartState._chartAxis._axisRenderersCollection[index];
if (axisRenderer._zoomFactor <= 1.0 && axisRenderer._zoomFactor > 0.0) {
if (axisRenderer._zoomFactor - 0.1 < 0) {
needZoom = false;
break;
} else {
zoomPanBehaviorRenderer._setZoomFactorAndZoomPosition(
chartState, axisRenderer, zoomFactor);
needZoom = true;
}
}
if (chart.onZooming != null) {
ZoomPanArgs? zoomingArgs;
_bindZoomEvent(chart, axisRenderer, zoomingArgs, chart.onZooming!);
}
}
if (needZoom == true) {
zoomPanBehaviorRenderer._createZoomState();
}
}