Category / Section
How to zoom y axis or x axis alone?
1 min read
To enable zooming feature in SfChart, add the ChartZoomPanBehavior instance to ChartBehaviors property of SfChart. This will allow you to zoom the chart both vertically and horizontally, by default. By using the ZoomMode property, you can specify whether the chart should be zoomed along any one direction (X or Y) or both directions (XY).
In the following code example, the ZoomMode property is set to Y. This will allow you to zoom only along y-axis while the zooming along x-axis is restricted.
XAML:
<chart:SfChart.ChartBehaviors> <chart:ChartZoomPanBehavior ZoomMode="Y"/> </chart:SfChart.ChartBehaviors>
C#:
chart.ChartBehaviors.Add(new ChartZoomPanBehavior() { ZoomMode = ZoomMode.Y });