SciChart Android 3D Charts API > ChartModifier 3D API > Zooming and Panning > Zoom Extents Modifier 3D
Zoom Extents Modifier 3D

Zooming and Panning a Chart in SciChart3D is achieved by moving the SciChart3DSurface.Camera to a new location.

The article "The SciChart3DSurface Camera" goes into detail how this camera class works and how to manipulate it programatically to achieve various views.

If you get lost and want to quickly zoom to fit the 3D Chart to the available space, you can use the ZoomExtentsModifier3D.

With this modifier enabled: Double-tap on the chart to zoom to fit. 

 

How does it work?

There are two modes of operation for the ZoomExtentsModifier3D.

Declaring a ZoomExtentsModifier3D

Declaring a ZoomExtentsModifier3D is as simple as adding one to the SciChart3DSurface.ChartModifiers property. This can be done as a single modifier, or as part of a ModifierGroup3D.

The following code will reset the camera position to 200,200,200 and target to 0,0,0 on double tap on screen.

Declaring Modifier
Copy Code
final ZoomExtentsModifier3D zoomExtentsModifier3D = new ZoomExtentsModifier3D();
zoomExtentsModifier3D.setIsEnabled(true);
zoomExtentsModifier3D.setExecuteOn(ExecuteOn.DoubleTap);
zoomExtentsModifier3D.setAutoFitRadius(false);
zoomExtentsModifier3D.setResetPosition(new Vector3(200, 200, 200));
zoomExtentsModifier3D.setResetTarget(new Vector3(0, 0, 0));
surface3d.getChartModifiers().add(new ModifierGroup3D(zoomExtentsModifier3D));