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.ZoomIntoRectangle(Rect) Method

Zoom a diagram into a specified rectangle.

Namespace: DevExpress.Xpf.Charts

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

NuGet Package: DevExpress.Wpf.Charts

#Declaration

public void ZoomIntoRectangle(
    Rect rectangle
)

#Parameters

Name Type Description
rectangle Rect

A Rect object specifying a rectangle to zoom into.

#Remarks

Use the following code to zoom a diagram into a rectangle:

XYDiagram2D diagram = (XYDiagram2D)chart.Diagram;
Rect rectangle = new Rect(new Point(200, 200), new Size(350, 350));
diagram.ZoomIntoRectangle(rectangle);

Before you call the ZoomIntoRectangle method, ensure that the diagram’s EnableAxisXNavigation and EnableAxisYNavigation properties are enabled.

To verify whether it is possible to zoom a diagram into a rectangle, call the XYDiagram2D.CanZoomIntoRectangle method.

See Also