The XAxisDragModifier
SciChart Android provides scale or pan an X Axis via the XAxisDragModifier, available out of the box.
Besides common features which are inherited from the ChartModifierBase class, the XAxisDragModifier allows to control its specific features via the following properties:
- setDragMode(AxisDragModifierBase.AxisDragMode dragMode) - allows to change the default axis scaling behavior to axis panning behavior - similarly to ZoomPanModifier via the AxisDragModifierBase.AxisDragMode enumeration.
- setMinTouchArea(float minTouchArea) - configures the sensitivity of the modifier.
- setClipModeX(ClipMode clipModeX) - allows to specify the behavior when scrolling reaches data extents in X direction via the ClipMode enumeration.
- setClipModeTargetX(ClipModeTarget clipModeTargetX) - allows to specify which target is used as limit by
clipModeX
when you reach the edge of theX-Axis
extents.
Adding a XAxisDragModifier to a Chart
Any Chart Modifier can be added to a SciChartSurface via the chartModifiers property and XAxisDragModifier is no difference:
// Assume a surface has been created and configured somewhere
// Create a Modifier
final XAxisDragModifier xAxisDragModifier = new XAxisDragModifier();
xAxisDragModifier.setDragMode(AxisDragModifierBase.AxisDragMode.Pan);
xAxisDragModifier.setClipModeX(ClipMode.StretchAtExtents);
xAxisDragModifier.setClipModeTargetX(ClipModeTarget.MaximumRange);
// Add the modifier to the surface
surface.getChartModifiers().add(xAxisDragModifier);
Note
To learn more about features available, please visit the Chart Modifier APIs article.