Quick Start Guide > Tutorials (Xamarin Android) > Xamarin Tutorial 04 - Adding Zooming, Panning Behaviors
Xamarin Tutorial 04 - Adding Zooming, Panning Behaviors
Source code for this tutorial can be found at our SciChart.Android.Examples Github Repository

Adding Zooming, Panning Behaviors

So far in the tutorial series, we have created a new chart, added an XAxis, YAxis, some series.

We're going  to extend this now to add zoom, pan behavior to the chart. Modify the code from Xamarin Tutorial 03 - Adding Series to a Chart as follows

Adding Zoom, Pan Behaviors
Copy Code
// Create interactivity modifiers
var pinchZoomModifier = new PinchZoomModifier();

var zoomPanModifier = new ZoomPanModifier();

var zoomExtentsModifier = new ZoomExtentsModifier();

var yAxisDragModifier = new YAxisDragModifier();

// Create modifier group from declared modifiers
var modifiers = new ModifierGroup(pinchZoomModifier, zoomPanModifier, zoomExtentsModifier, yAxisDragModifier);

// Add the interactions to the ChartModifiers collection of the chart

After rebuilding and running the application you should be able to pan and zoom chart.


See Also