Skip to main content

Mouse Wheel Zoom Modifier 3D

Zooming and Panning a Chart in SciChart.js 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 want to add simple zooming in/out of the camera to the chart then you can do so using our ChartModifiers API. The MouseWheelZoomModifier3D📘 performs movement of the camera by adjusting the radius property,  giving the appearance of the chart zooming.

Declaring an MouseWheelZoomModifier3D

Declaring a MouseWheelZoomModifier3D📘 is as simple as adding one to the SciChart3DSurface.chartModifiers📘 property. This can be done as a single modifier, or as part of a group.

// const { MouseWheelZoomModifier3D } = SciChart;
// or for npm: import { MouseWheelZoomModifier3D } from "scichart"

sciChart3DSurface.chartModifiers.add(new MouseWheelZoomModifier3D());

This results in the following behaviour added to the chart.