Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Individually Adjust Axes Zooming (Runtime Sample)

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;
}
See Also