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

XYDiagram2D.CanZoomIn() Method

Checks whether it is possible to zoom in to a diagram.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v24.2.dll

NuGet Package: DevExpress.Wpf.Charts

#Declaration

public bool CanZoomIn()

#Returns

Type Description
Boolean

true if it is allowed to zoom in; otherwise, false.

#Remarks

The following code changes the cursor’s appearance when the chart is displayed at the maximum zoom level:

private void chartControl1_QueryChartCursor(object sender, QueryChartCursorEventArgs e) {
    ChartControl chart = (ChartControl)sender;
        XYDiagram2D diagram = (XYDiagram2D)chart.Diagram;
            if (!diagram.CanZoomIn()) {
                e.Cursor = Cursors.None;
                e.CursorImage = new BitmapImage(new Uri(@"/CustomCursor;component/mycursor.png", UriKind.Relative));
    }
}

To zoom in to a diagram, use the XYDiagram2D.ZoomIn method.

See Also