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.ScrollAxisXTo(Double) Method

Scrolls the X-axis to the specified position.

Namespace: DevExpress.Xpf.Charts

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

NuGet Package: DevExpress.Wpf.Charts

#Declaration

public void ScrollAxisXTo(
    double xPosition
)

#Parameters

Name Type Description
xPosition Double

A Double value that specifies the position to which to scroll. The value should be in the [0;1] range where 0 defines the beginning of the axis and 1 is the end.

#Remarks

The following code scrolls a diagram to the position passed as a parameter:

XYDiagram2D diagram = (XYDiagram2D)chart.Diagram;
diagram.ScrollAxisXTo(0.5);

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

To verify whether it is possible to scroll the X-axis, call the XYDiagram2D.CanScrollAxisXTo method.

See Also