SciChart Android 2D Charts API > ChartModifier API > Zooming and Panning > ZoomPanModifier

SciChart for Android provides an inertial scrolling / panning behavior via the ZoomPanModifier, available out of the box.

Besides common features which are inherited from the ChartModifierBase class, the ZoomPanModifier allows to restrict scrolling to the horizontal or vertical direction only, via the getDirection()setDirection() methods. It is possible to configure it to keep series' peeks always in viewport via the setZoomExtentsY() method.

Also, the setClipModeX() method allows to specify the behavior when scrolling reaches data extents in X direction. There are several behavioral modes defined by the ClipMode enumeration.

Adding a ZoomPanModifier to a Chart

A ChartModifier can be added to a ChartModifiersCollection of a SciChartSurface via the getChartModifiers()setChartModifiers() methods. This can be done using the code below:

Copy Code
// Assume the surface has been created and configured earlier
ISciChartSurface surface;

// Create a ZoomPanModifier
ZoomPanModifier zoomPanModifier = new ZoomPanModifier();

// Add the modifier to the surface

Also a ZoomPanModifier can be created using Chart Builders. To learn more about features available, Please refer to the Common ChartModifiers Features article.

See Also