iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x

The SCIZoomExtentsModifier

SciChart iOS provides the ability to zoom-to-fit the entire chart double-tapping it via the SCIZoomExtentsModifier, available out of the box.

Besides common features which are inherited from the SCIChartModifierBase class, the SCIZoomExtentsModifier allows to control its specific features via the following properties:

NOTE: There are several modes defined by the SCIExecuteOn enumeration, such as Single Tap, Double Tap, Long Press, and Fling.

Adding a SCIZoomExtentsModifier to a Chart

Any Chart Modifier can be added to a SCIChartSurface via the ISCIChartSurface.chartModifiers property and SCIZoomExtentsModifier with no difference:

// Assume a surface has been created and configured somewhere id<ISCIChartSurface> surface; // Create a Modifier SCIZoomExtentsModifier *zoomExtentsModifier = [SCIZoomExtentsModifier new]; zoomExtentsModifier.direction = SCIDirection2D_XDirection; zoomExtentsModifier.executeOn = SCIExecuteOn_DoubleTap; zoomExtentsModifier.isAnimated = YES; // Add the modifier to the surface [self.surface.chartModifiers add:zoomExtentsModifier];
// Assume a surface has been created and configured somewhere let surface: ISCIChartSurface // Create a Modifier let zoomExtentsModifier = SCIZoomExtentsModifier() zoomExtentsModifier.direction = .xDirection zoomExtentsModifier.executeOn = .doubleTap zoomExtentsModifier.isAnimated = true // Add the modifier to the surface self.surface.chartModifiers.add(zoomExtentsModifier)
// Assume a surface has been created and configured somewhere IISCIChartSurface surface; // Create a Modifier var zoomExtentsModifier = new SCIZoomExtentsModifier(); zoomExtentsModifier.Direction = SCIDirection2D.XDirection; zoomExtentsModifier.ExecuteOn = SCIExecuteOn.DoubleTap; zoomExtentsModifier.IsAnimated = true; // Add the modifier to the surface Surface.ChartModifiers.Add(zoomExtentsModifier);

NOTE: To learn more about features available, please visit the Chart Modifier APIs article.

Programmatically Zoom to Extents

You can also run Zoom to Extents functionality programmatically without adding SCIZoomExtentsModifier. SCIChartSurface supports the following methods which you can call whenever you need to zoom the chart to fit: