Back to Devexpress

XYDiagram2D.Scroll Event

wpf-devexpress-dot-xpf-dot-charts-dot-xydiagram2d-4ad5f0a9.md

latest7.1 KB
Original Source

XYDiagram2D.Scroll Event

Occurs after an XYDiagram2D is scrolled.

Namespace : DevExpress.Xpf.Charts

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

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public event XYDiagram2DScrollEventHandler Scroll
vb
Public Event Scroll As XYDiagram2DScrollEventHandler

Event Data

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

PropertyDescription
AxisXGets the X-axis, along which the scrolling has been performed.
AxisYGets the Y-axis, along which the scrolling has been performed.
HandledGets 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.
NewAxisXRangeObsolete. Gets the new value of the Axis.Range property for the X-axis.
NewAxisYRangeObsolete. Gets the new value of the Axis.Range property for the Y-axis.
NewXRangeGets the new value of the Axis2D.VisualRange property of the X-axis.
NewYRangeGets the new value of the Axis2D.VisualRange property of the Y-axis.
OldAxisXRangeObsolete. Gets the old value of the Axis.Range property for the X-axis.
OldAxisYRangeObsolete. Gets the old value of the Axis.Range property for the Y-axis.
OldXRangeGets the old value of the Axis2D.VisualRange property of the X-axis.
OldYRangeGets the old value of the Axis2D.VisualRange property of the Y-axis.
OriginalSourceGets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.
PaneGets a pane along which scrolling has been performed.
RoutedEventGets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
ScrollOrientationGets the scrolling orientation, i.e. along which axis scrolling is performed.
SourceGets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.
TypeGets the scrolling type, which specifies scrolling characteristics.

The event data class exposes the following methods:

MethodDescription
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.

csharp
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.
}
vb
Private Sub XYDiagram2D_Scroll(ByVal sender As Object, ByVal e As XYDiagram2DScrollEventArgs)
    'Get new range limits.
    Dim newXRangeMin As Object = e.NewXRange.MinValue
    Dim newXRangeMax As Object = e.NewXRange.MaxValue
    Dim newYRangeMin As Object = e.NewYRange.MinValue
    Dim newYRangeMax As Object = e.NewYRange.MaxValue
    'Add your custom logic here.
End Sub

See Also

Zoom

XYDiagram2D Class

XYDiagram2D Members

DevExpress.Xpf.Charts Namespace