Back to Devexpress

XYDiagram2D.Zoom Event

wpf-devexpress-dot-xpf-dot-charts-dot-xydiagram2d-2cf36db6.md

latest6.9 KB
Original Source

XYDiagram2D.Zoom Event

Occurs after an XYDiagram2D has been zoomed in or out.

Namespace : DevExpress.Xpf.Charts

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

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public event XYDiagram2DZoomEventHandler Zoom
vb
Public Event Zoom As XYDiagram2DZoomEventHandler

Event Data

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

PropertyDescription
AxisXGets the X-axis, along which zooming has been performed.
AxisYGets the Y-axis, along which the zooming 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 zooming has been performed.
RoutedEventGets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
SourceGets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.
TypeGets the zooming type, which specifies zooming 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.Zoom event to track range changes when a user zooms in to or out of the chart:

csharp
private void XYDiagram2D_Zoom(object sender, DevExpress.Xpf.Charts.XYDiagram2DZoomEventArgs 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_Zoom(ByVal sender As Object, ByVal e As DevExpress.Xpf.Charts.XYDiagram2DZoomEventArgs)
    '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

Scroll

XYDiagram2D Class

XYDiagram2D Members

DevExpress.Xpf.Charts Namespace