SciChart iOS v2.x API > ChartModifier API > Combining Multiple Zoom Modifiers
Combining Multiple Zoom Modifiers

SciChart allows you to combine an unlimited number of ChartModifiers via the SCIModifierGroup type. To use this type, simply declare a new SCIModifierGroup and initialize with one or more child modifiers.

 

SCIXAxisDragModifier * xDragModifier = [SCIXAxisDragModifier new];
xDragModifier.axisId = @"xAxis";
xDragModifier.dragMode = SCIAxisDragMode_Scale;
xDragModifier.clipModeX = SCIClipMode_None;
SCIYAxisDragModifier * yDragModifier = [SCIYAxisDragModifier new];
yDragModifier.axisId = @"yAxis";
yDragModifier.dragMode = SCIAxisDragMode_Pan;

SCIPinchZoomModifier * pzm = [[SCIPinchZoomModifier alloc] init];
SCIZoomExtentsModifier * zem = [[SCIZoomExtentsModifier alloc] init];
SCICursorModifier * cursor = [[SCICursorModifier alloc] init];
cursor.style.hitTestMode = SCIHitTest_Point;
cursor.style.colorMode = SCITooltipColorMode_SeriesColorToDataView;
[cursor.style setTooltipSize:CGSizeMake(200, NAN)];
[zem setModifierName:@"ZoomExtents Modifier"];
[pzm setModifierName:@"PinchZoom Modifier"];
[cursor setModifierName:@"Cursor Modifier"];
[yDragModifier setModifierName:@"Y Axis Drag Modifier"];
[xDragModifier setModifierName:@"X Axis Drag Modifier"];

SCIChartModifierCollection * gm = [[SCIChartModifierCollection alloc] initWithChildModifiers:@[xDragModifier,
  yDragModifier, pzm, zem, cursor]];
surface.chartModifiers = gm;
let xAxisDragmodifier = SCIXAxisDragModifier()
xAxisDragmodifier.dragMode = .scale
xAxisDragmodifier.clipModeX = .none
let yAxisDragmodifier = SCIYAxisDragModifier()
yAxisDragmodifier.dragMode = .pan
let extendZoomModifier = SCIZoomExtentsModifier()
let pinchZoomModifier = SCIPinchZoomModifier()
let rolloverModifier = SCIRolloverModifier()
rolloverModifier.style.tooltipSize = CGSize(width: 200, height: CGFloat.nan)
let groupModifier = SCIChartModifierCollection(childModifiers: [xAxisDragmodifier, 
 yAxisDragmodifier, pinchZoomModifier, extendZoomModifier, rolloverModifier])

let cursor = SCICursorModifier()
cursor.style.hitTestMode = .point
cursor.modifierName = "CursorModifier"
cursor.style.hitTestMode = .point
cursor.style.colorMode = SCITooltipColorMode.seriesColorToDataView;
cursor.style.tooltipSize = CGSize(width: 200, height: CGFloat.nan)
groupModifier.add(cursor)
surface.chartModifiers = groupModifier