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

Zoom Extents Modifier 3D

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

Besides common features which are inherited from the SCIChartModifier3DBase class, the SCIZoomExtentsModifier3D 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.

There are two modes of operation for the SCIZoomExtentsModifier3D - AutoFit and Manual:

Operation Mode Description
autoFitRadius = YES Tries to automatically fit the 3D scene into the viewport. and ISCICameraController.position properties are ignored.
autoFitRadius = NO You should specify the precise coordinates for the and ISCICameraController.position properties.

Adding a SCIZoomExtentsModifier to a Chart

Any Chart Modifier 3D can be added to a SCIChartSurface3D via the ISCIChartSurface3D.chartModifiers property and SCIZoomExtentsModifier3D with no difference:

// Assume a surface 3D has been created and configured somewhere id<ISCIChartSurface3D> surface; // Create a Modifier SCIZoomExtentsModifier3D *zoomExtentsModifier3D = [SCIZoomExtentsModifier3D new]; zoomExtentsModifier3D.executeOn = SCIExecuteOn_DoubleTap; zoomExtentsModifier3D.autoFitRadius = NO; zoomExtentsModifier3D.resetPosition = [[SCIVector3 alloc] initWithX:200 y:200 z:200]; zoomExtentsModifier3D.resetTarget = [[SCIVector3 alloc] initWithX:0 y:0 z:0]; // Add the modifier to the surface [self.surface.chartModifiers add:zoomExtentsModifier3D];
// Assume a surface has been created and configured somewhere let surface: ISCIChartSurface3D // Create a Modifier let zoomExtentsModifier3D = SCIZoomExtentsModifier3D() zoomExtentsModifier3D.executeOn = .doubleTap zoomExtentsModifier3D.autoFitRadius = false zoomExtentsModifier3D.resetPosition = SCIVector3(x: 200, y: 200, z: 200) zoomExtentsModifier3D.resetTarget = SCIVector3(x: 0, y: 0, z: 0) // Add the modifier to the surface self.surface.chartModifiers.add(zoomExtentsModifier3D)
// Assume a surface 3D has been created and configured somewhere IISCIChartSurface3D surface; // Create a Modifier var zoomExtentsModifier3D = new SCIZoomExtentsModifier3D(); zoomExtentsModifier3D.ExecuteOn = SCIExecuteOn.DoubleTap; zoomExtentsModifier3D.AutoFitRadius = false; zoomExtentsModifier3D.ResetPosition = new SCIVector3(200, 200, 200); zoomExtentsModifier3D.ResetTarget = new SCIVector3(0, 0, 0); // Add the modifier to the surface Surface.ChartModifiers.Add(zoomExtentsModifier3D);

NOTE: To learn more about features available, please read on the Chart Modifier 3D APIs article.

Programmatically Zoom to Extents

You can also run Zoom to Extents functionality programmatically without adding SCIZoomExtentsModifier3D. The SCICamera3D object which is associated with SCIChartSurface3D provides the following methods which you can call whenever you need to zoom the chart to fit: