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

SciChart for Android provides zooming via drag rectangle on a chart with the RubberBandXyZoomModifier. Besides common features which are inherited from the ChartModifierBase class, the RubberBandXyZoomModifier defines a bunch of behavioral traits itself. Please find these in the table below:  

Feature Description
getIsXAxisOnly()setIsXAxisOnly() Allows to restrict zooming behavior to the X Axis only.
getIsAnimated() / setIsAnimated() Allows to switch on / off the animation on zoom.
getMinDragSensitivity()setMinDragSensitivity() Allows to specify the drag rectangle's minimal possible size. Rectangles smaller than this size in the diagonal will be ignored when zooming.
getZoomExtentsY()setZoomExtentsY() Determines whether to perform zoom to extents on the Y Axis on the each zoom operation or not.
getRubberBandStrokeStyle()setRubberBandStrokeStyle() Allows to assign an PenStyle object to the outline of the drag rectangle. Please refer to the Styling and Theming section for more details.
getRubberBandFillStyle()setRubberBandFillStyle() Allows to assign an BrushStyle object to fill the drag rectangle. Please refer to the Styling and Theming section for more details.

Adding a RubberBandXyZoomModifier 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 RubberBandXyZoomModifier
RubberBandXyZoomModifier rubberBandZoomModifier = new RubberBandXyZoomModifier();

// Apply a BrushStyle for fill
BrushStyle brushStyle = new SolidBrushStyle(0x33999999);

// Apply a PenStyle for stroke
PenStyle strokeStyle = new SolidPenStyle(0x77999999, true, 1f, null);

// Add the modifier to the surface

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

See Also