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

The YAxisDragModifier provides the capability to scale or pan an Y Axis via finger drag.

Besides common features which are inherited from the ChartModifierBase class, the YAxisDragModifier allows to change the default axis scaling behavior to axis panning behavior (ZoomPanModifier alike). This can be done via the setDragMode() method, which accepts a member of the AxisDragMode enumeration.

Also, it is possible to configure the sensitivity of the modifier via the setMinTouchArea() method.

Adding a YAxisDragModifier 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 an YAxisDragModifier
YAxisDragModifier yAxisDrag = new YAxisDragModifier();
yAxisDrag.setDragMode(AxisDragModifierBase.AxisDragMode.Pan);

// Add the modifier to the surface
surface.getChartModifiers().add(yAxisDrag);

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

See Also