iOS Charting Documentation - SciChart iOS Charts SDK v3.x

Axis Ranging - How to listen to VisibleRange Changes

It is possible to subscribe to listening to the ISCIAxisCore.visibleRange changes using a SCIVisibleRangeChangeListener:

id<ISCIAxis> axis = [SCINumericAxis new]; axis.visibleRangeChangeListener = ^(id axis, id oldRange, id newRange, BOOL isAnimating) { // TODO: handle range changes here };
let axis = SCINumericAxis() axis.visibleRangeChangeListener = { (axis, oldRange, newRange, isAnimating) in // TODO: handle range changes here }
var xAxis = new SCINumericAxis(); xAxis.VisibleRangeChanged += (IISCIAxisCore axis, IISCIRange oldRange, IISCIRange newRange, bool isAnimating) => { // TODO: handle range changes here };

NOTE: You can differentiate between changes that were part of an animation by checking the isAnimating parameter. For example, an animated zoom to extents operation will fire the callback many times with isAnimated = true, then once at the end with isAnimated = false.

The most typical use for this callback is to perform some kind of operation when the ISCIAxisCore.visibleRange changes, such as updating UI.

It is also possible to use this callback to restrict the VisibleRange in some way, e.g set a bounded or clipped range onto Axis.VisibleRange when the range changes outside of a desired area.

NOTE: We’ve already used this technique in Advanced VisibleRange Clipping

See Also