Back to Devexpress

XYDiagram2D.ZoomIntoRectangle(Rect) Method

wpf-devexpress-dot-xpf-dot-charts-dot-xydiagram2d-dot-zoomintorectangle-x28-system-dot-windows-dot-rect-x29.md

latest2.2 KB
Original Source

XYDiagram2D.ZoomIntoRectangle(Rect) Method

Zoom a diagram into a specified rectangle.

Namespace : DevExpress.Xpf.Charts

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

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public void ZoomIntoRectangle(
    Rect rectangle
)
vb
Public Sub ZoomIntoRectangle(
    rectangle As Rect
)

Parameters

NameTypeDescription
rectangleRect

A Rect object specifying a rectangle to zoom into.

|

Remarks

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

csharp
XYDiagram2D diagram = (XYDiagram2D)chart.Diagram;
Rect rectangle = new Rect(new Point(200, 200), new Size(350, 350));
diagram.ZoomIntoRectangle(rectangle);
vb
Dim diagram As XYDiagram2D = CType(chart.Diagram, XYDiagram2D)
Dim rectangle As Rect = 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

Zoom and Scroll in 2D XY-Charts

XYDiagram2D Class

XYDiagram2D Members

DevExpress.Xpf.Charts Namespace