Skip to main content

XYDiagram2D.Scroll Event

Occurs after an XYDiagram2D is scrolled.

Namespace: DevExpress.Xpf.Charts

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

NuGet Package: DevExpress.Wpf.Charts

Declaration

public event XYDiagram2DScrollEventHandler Scroll

Event Data

The Scroll event's data class is XYDiagram2DScrollEventArgs. The following properties provide information specific to this event:

Property Description
AxisX Gets the X-axis, along which the scrolling has been performed.
AxisY Gets the Y-axis, along which the scrolling has been performed.
Handled Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route. Inherited from RoutedEventArgs.
NewAxisXRange Obsolete. Gets the new value of the Axis.Range property for the X-axis.
NewAxisYRange Obsolete. Gets the new value of the Axis.Range property for the Y-axis.
NewXRange Gets the new value of the Axis2D.VisualRange property of the X-axis.
NewYRange Gets the new value of the Axis2D.VisualRange property of the Y-axis.
OldAxisXRange Obsolete. Gets the old value of the Axis.Range property for the X-axis.
OldAxisYRange Obsolete. Gets the old value of the Axis.Range property for the Y-axis.
OldXRange Gets the old value of the Axis2D.VisualRange property of the X-axis.
OldYRange Gets the old value of the Axis2D.VisualRange property of the Y-axis.
OriginalSource Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.
Pane Gets a pane along which scrolling has been performed.
RoutedEvent Gets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
ScrollOrientation Gets the scrolling orientation, i.e. along which axis scrolling is performed.
Source Gets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.
Type Gets the scrolling type, which specifies scrolling characteristics.

The event data class exposes the following methods:

Method Description
InvokeEventHandler(Delegate, Object) When overridden in a derived class, provides a way to invoke event handlers in a type-specific way, which can increase efficiency over the base implementation. Inherited from RoutedEventArgs.
OnSetSource(Object) When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes. Inherited from RoutedEventArgs.

Remarks

You can use the XYDiagram2D.Scroll event to track range changes when a user scrolls the chart.

private void XYDiagram2D_Scroll(object sender, XYDiagram2DScrollEventArgs e) {
    // Get new range limits.
    object newXRangeMin = e.NewXRange.MinValue;
    object newXRangeMax = e.NewXRange.MaxValue;
    object newYRangeMin = e.NewYRange.MinValue;
    object newYRangeMax = e.NewYRange.MaxValue;
    // Add your custom logic here.
}
See Also