windowsforms-7571-controls-and-libraries-chart-control-examples-end-user-interaction-how-to-individually-adjust-axes-zooming-runtime-sample.md
This example demonstrates how you can individually adjust zooming for different panes along the required axes. A chart with two panes is used to demonstrate this feature.
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraCharts;
// ...
private void Form1_Load(object sender, EventArgs e) {
// Cast the chart's diagram to the XYDiagram type, to access its panes.
XYDiagram diagram = (XYDiagram)chartControl1.Diagram;
// Enable the X-axis zooming at the diagram's level.
diagram.EnableAxisXZooming = true;
// Individually enable zooming for panes.
diagram.DefaultPane.EnableAxisXZooming = DefaultBoolean.True;
diagram.Panes[0].EnableAxisXZooming = DefaultBoolean.False;
// Specify how zooming is performed.
diagram.ZoomingOptions.UseKeyboard = false;
diagram.ZoomingOptions.UseKeyboardWithMouse = true;
diagram.ZoomingOptions.UseMouseWheel = true;
}
Imports System.Windows.Forms
Imports DevExpress.Utils
Imports DevExpress.XtraCharts
' ...
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As EventArgs) Handles MyBase.Load
' Cast the chart's diagram to the XYDiagram type, to access its panes.
Dim diagram As XYDiagram = CType(chartControl1.Diagram, XYDiagram)
' Enable the X-axis zooming at the diagram's level.
diagram.EnableAxisXZooming = True
' Individually enable zooming for panes.
diagram.DefaultPane.EnableAxisXZooming = DefaultBoolean.True
diagram.Panes(0).EnableAxisXZooming = DefaultBoolean.False
' Specify how zooming is performed.
diagram.ZoomingOptions.UseKeyboard = False
diagram.ZoomingOptions.UseKeyboardWithMouse = True
diagram.ZoomingOptions.UseMouseWheel = True
End Sub
See Also