本示例展示了如何分别调整不同 窗格 的缩放 (沿所需的 轴)。 使用有两个窗格的图表来演示此功能。
C# | 复制代码 |
---|---|
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; } |
Visual Basic | 复制代码 |
---|---|
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 |