The PinchZoomModifier
SciChart Android provides pinch zooming via the PinchZoomModifier, available out of the box.
Besides common features which are inherited from the ChartModifierBase class, the PinchZoomModifier allows to control its specific features via the following properties:
- setScaleFactor(float scaleFactor) - allows to set ScaleFactor to change zooming speed.
- setDirection(Direction2D direction) - allows to restrict zooming to the horizontal or vertical direction only if needed.
Adding a PinchZoomModifier to a Chart
Any Chart Modifier can be added to a SciChartSurface via the chartModifiers property and PinchZoomModifier is no difference:
// Assume a surface has been created and configured somewhere
// Create a Modifier
PinchZoomModifier pinchZoomModifier = new PinchZoomModifier();
pinchZoomModifier.setDirection(Direction2D.XDirection);
pinchZoomModifier.setScaleFactor(1.5f);
// Add the modifier to the surface
surface.getChartModifiers().add(pinchZoomModifier);
Note
To learn more about features available, please visit the Chart Modifier APIs article.