Quick Start Guide > Tutorials (Java Android) > Tutorial 04 - Adding Zooming, Panning Behavior
Tutorial 04 - Adding Zooming, Panning Behavior

Following on from Tutorial 04 - Adding Series to a Chart where we created some series, we will now add zooming, panning behaviors to the chart.

Source code for this tutorial can be found at our SciChart.Android.Examples Github Repository under v5.x > Tutorials

Adding Zooming, Panning Behaviors

So far in the tutorial series, we have created a new chart, added an XAxis, YAxis, some series and also some simple zoom modifiers. We are going to extend this now and add some more interaction behaviors.

Adding ChartModifiers to a SciChartSurface

In SciChart, all chart interactions are defined by ChartModifiers. Besides several modifiers provided out of the box, it is possible to write custom modifiers or extends the existing ones. The provided modifiers include PinchZoomModifierRubberBandXyZoomModifierZoomPanModifierZoomExtentsModifierCursorModifierRolloverModifier, SeriesSelectionModifier and others.

Now we are going to create and configure a couple of new modifiers using SciChartBuilder and add them to the ChartModifiers collection of the SciChartSurface:

Copy Code
// Add a bunch of interaction modifiers to a ModifierGroup
ModifierGroup additionalModifiers = sciChartBuilder.newModifierGroup()







// Add the modifiers to the SciChartSurface

After re-building and running the application the chart should behave like this:


Further Reading

To learn more about the zooming and panning modifiers provided by SciChart out of the box please find links to the corresponding documentation articles below:

Also you can find out about the ChartModifiers API and how to use it to create custom chart modifiers in the Custom Modifiers - ChartModifierBase API article.

See Also