iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x
The SCIPinchZoomModifier
SciChart iOS provides pinch zooming via the SCIPinchZoomModifier, available out of the box.
Besides common features which are inherited from the SCIChartModifierBase class,
the SCIPinchZoomModifier allows to control its specific features via the following properties:
SCIPinchZoomModifier.scaleFactor- allows to set ScaleFactor to change zooming speed.SCIPinchZoomModifier.direction- allows to restrict zooming to the horizontal or vertical direction only if needed.
Adding a SCIPinchZoomModifier to a Chart
Any Chart Modifier can be added to a SCIChartSurface via the ISCIChartSurface.chartModifiers property and SCIPinchZoomModifier with 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. This feature is especially useful in multiple-axis charts, where you may want to zoom only selected axes while keeping others fixed. 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 Pinch Zoom
The SCIPinchZoomModifier allows you to include or exclude certain axis from the pinch zoom operation.
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.
FAQ
Q: How to keyboard zoom on +/- keys in macOS?
A: To implement zooming via keyboard on macOS using the + and - keys, override the keyDown(with:) method in your chart-hosting view or responder, detect the appropriate key input, compute a zoom scale, and update the visibleRange of your SCINumericAxis accordingly.
For more details, see the documentation:
Zoom and Pan – Mouse Wheel and Trackpad Support
Q: Whether chart content supports mouse-wheel zooming
A: We don’t have a built in scroll modifier for macOS, but it would done by overriding scrollWheel(with event: NSEvent) method.
For more details, see the documentation:
Zoom and Pan – Mouse Wheel and Trackpad Support
View on GitHub