iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x
The SCIZoomPanModifier
SciChart iOS provides an inertial scrolling / panning behavior via the SCIZoomPanModifier, available out of the box.
Besides common features which are inherited from the SCIChartModifierBase class,
the SCIZoomPanModifier allows to control its specific features via the following properties:
SCIZoomPanModifier.direction- allows to restrict zooming to the horizontal or vertical direction only if needed.SCIZoomPanModifier.zoomExtentsY- allows to to keep series’ peeks always in viewport.SCIZoomPanModifier.clipModeX- allows to specify the behavior when scrolling reaches data extents in X direction via theSCIClipModeenumeration.
There are several modes defined by the SCIClipMode enumeration:
None- Means you can pan right off the edge of the data into uncharted space.StretchAtExtents- Causes a zooming (stretch) action when you reach the edge of the data.ClipAtMin- Forces the panning operation to stop suddenly at the minimum of the data, but expand at the maximum.ClipAtMax- Forces the panning operation to stop suddenly at the maximum of the data, but expand at the minimum.ClipAtExtents- Forces the panning operation to stop suddenly at the extents of the data.
There are two touch events defined by the SCIZoomState enumeration, which can be used to get or set current interaction state of the surface:
- AtExtents indicates that the zoom level is at extents.
- UserZooming indicates User has initiated a Zoom operation.
The allowsGestureOnAxis property enables or disables the application of modifiers, such as pan and pinch gestures, specifically on axis elements.
This property controls whether dragging or pinching gestures performed by the user on the axis will trigger the associated modifier actions.
true- Enables the modifier actions (pan, pinch) on the axis.false- Disables the modifier actions (pan, pinch) on the axis. The default value for allowsGestureOnAxis isfalse.
It is particularly useful in scenarios where you may want to restrict or allow user interactions specifically on the axis, while still allowing interactions elsewhere on the chart surface.
Adding a SCIZoomPanModifier to a Chart
Any Chart Modifier can be added to a SCIChartSurface via theISCIChartSurface.chartModifiers property and SCIZoomPanModifier is no difference:
Additional Properties
Restricting Interaction to a Single Direction (X or Y)
Interaction for this modifier can be limited to a specific axis direction by configuring the direction property. Set direction to one of the SCIDirection2D values to restrict the modifier to the X-axis, Y-axis, or both.
Include/Exclude Certain Axis from Pan Zoom
The SCIZoomPanModifier allows you to include or exclude certain axis from the pan zoom operation.
This feature is especially useful in multiple-axis charts, where you may want to pan only selected axes while keeping others fixed.
By default all axis are included, to exclude one or more X or Y axis, set the following property:
NOTE: To learn more about features available, please visit the Chart Modifier APIs article.
NOTE: The
setDisableTouchEvent:method is used to allow or prevent userInteraction of a surface view when it is inside a scroll view. It acceptsdisableTouchEvent, a Boolean value that determines whether user touch events are ignored or not.YES- Touch events will be ignored (i.e., user interaction is disabled).NO- Touch events will be recognized (i.e., user interaction is enabled).
View on GitHub