How to Perform Exclusive Zoom for Individual Axis in MAUI Chart?
This article will guide you in enabling exclusive zoom for an individual axis in the .NET MAUI Chart.
Create an instance of ChartZoomPanBehavior and set it to the ZoomPanBehavior property of SfCartesianChart to enable the zooming in the chart.
The zooming can be done both horizontally and vertically. The zooming direction is defined 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:SfCartesianChart>
<chart:SfCartesianChart.ZoomPanBehavior>
<chart:ChartZoomPanBehavior ZoomMode="Y" />
</chart:SfCartesianChart.ZoomPanBehavior>
...
</chart:SfCartesianChart>
[C#]
SfCartesianChart chart = new SfCartesianChart();
...
ChartZoomPanBehavior zooming = new ChartZoomPanBehavior()
{
ZoomMode = ZoomMode.Y
};
chart.ZoomPanBehavior = zooming;
...
Output
Conclusion
I hope you enjoyed learning how to perform exclusive zoom for an individual axis in the .NET MAUI Chart.
You can refer to our .NET MAUI CartesianChart feature tour page to know about its other groundbreaking feature representations. You can also explore our .NET MAUI Chart documentation to understand how to present and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trail to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!