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:

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.

Adding a SCIZoomPanModifier to a Chart

Any Chart Modifier can be added to a SCIChartSurface via theISCIChartSurface.chartModifiers property and SCIZoomPanModifier is no difference:

// Assume a surface has been created and configured somewhere id<ISCIChartSurface> surface; // Create a Modifier SCIZoomPanModifier *zoomPanModifier = [SCIZoomPanModifier new]; zoomPanModifier.direction = SCIDirection2D_XDirection; zoomPanModifier.clipModeX = SCIClipMode_StretchAtExtents; zoomPanModifier.clipModeY = SCIClipMode_None; zoomPanModifier.zoomExtentsY = YES; // Add the modifier to the surface [self.surface.chartModifiers add:zoomPanModifier];
// Assume a surface has been created and configured somewhere let surface: ISCIChartSurface // Create a Modifier let zoomPanModifier = SCIZoomPanModifier() zoomPanModifier.direction = .xDirection zoomPanModifier.clipModeX = .stretchAtExtents zoomPanModifier.clipModeY = .none zoomPanModifier.zoomExtentsY = true // Add the modifier to the surface self.surface.chartModifiers.add(zoomPanModifier)
// Assume a surface has been created and configured somewhere IISCIChartSurface surface; // Create a Modifier var zoomPanModifier = new SCIZoomPanModifier(); zoomPanModifier.Direction = SCIDirection2D.XDirection; zoomPanModifier.ClipModeX = SCIClipMode.StretchAtExtents; zoomPanModifier.ClipModeY = SCIClipMode.None; zoomPanModifier.ZoomExtentsY = true; // Add the modifier to the surface Surface.ChartModifiers.Add(zoomPanModifier);

NOTE: To learn more about features available, please visit the Chart Modifier APIs article.