Skip to main content

XYDiagram2D.Zoom Event

Occurs after an XYDiagram2D has been zoomed in or out.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v22.1.dll

Declaration

public event XYDiagram2DZoomEventHandler Zoom

Event Data

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

Property Description
AxisX Gets the X-axis, along which zooming has been performed.
AxisY Gets the Y-axis, along which the zooming 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 zooming has been performed.
RoutedEvent Gets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
Source Gets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.
Type Gets the zooming type, which specifies zooming 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.Zoom event to track range changes when a user zooms in to or out of the chart:

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.
}
See Also