iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x

The Impulse (Stem) Series Type

Impulse Charts are provided by the SCIFastImpulseRenderableSeries class and is a hybrid of Column Series and Scatter Series. It accepts data (X, Y) from a SCIXyDataSeries and draws a single line from zeroLineY to the [X, Y] value with an optional ISCIPointMarker.

NOTE: Examples for the Impulse Series can be found in the SciChart iOS Examples Suite as well as on GitHub:

Like the SCIXyScatterRenderableSeries type, SCIFastImpulseRenderableSeries requires a shape to be specified for the Point Markers. There are several shapes available out of the box, as well as it is possible to define custom shapes of the Point Markers.

NOTE: For the detailed description of Point Markers, please see the PointMarkers API article.

Similarly to the SCIFastColumnRenderableSeries type, it is possible to specify the baseline position for series’ bars via the SCIRenderableSeriesBase.zeroLineY property. All data points that have Y value less than ZeroLineY (baseline) will be drawn downwards, else - upwards:

Impulse Series Baseline

Finally, the stem color can be changed via the ISCIRenderableSeries.strokeStyle property.

NOTE: To learn more about Pens and Brushes and how to utilize them, please refer to the SCIPenStyle, SCIBrushStyle and SCIFontStyle article.

NOTE: In multi axis scenarios, a series has to be assigned to particular X and Y axes. This can be done passing the axes IDs to the ISCIRenderableSeries.xAxisId, ISCIRenderableSeries.yAxisId properties.

Create an Impulse Series

To create an Impulse Series, use the following code:

// Assume a surface has been created and configured somewhere id<ISCIChartSurface> surface; // Create a PointMarker instance id<ISCIPointMarker> pointMarker = [SCIEllipsePointMarker new]; pointMarker.size = (CGSize){ .width = 15, .height = 15 }; pointMarker.strokeStyle = [[SCISolidPenStyle alloc] initWithColor:UIColor.yellowColor thickness:2.0]; pointMarker.fillStyle = [[SCISolidBrushStyle alloc] initWithColorCode:0xFF0066FF]; // Create DataSeries and fill it with some data SCIXyDataSeries *dataSeries = [[SCIXyDataSeries alloc] initWithXType:SCIDataType_Double yType:SCIDataType_Double]; // Create and add Scatter Series id<ISCIRenderableSeries> impulseSeries = [SCIXyScatterRenderableSeries new]; impulseSeries.dataSeries = dataSeries; impulseSeries.pointMarker = pointMarker; impulseSeries.strokeStyle = [[SCISolidPenStyle alloc] initWithColor:UIColor.yellowColor thickness:1.0]; impulseSeries.zeroLineY = 0.2; [surface.renderableSeries add:impulseSeries];
// Assume a surface has been created and configured somewhere let surface: ISCIChartSurface // Create a PointMarker instance let pointMarker = SCIEllipsePointMarker() pointMarker.size = CGSize(width: 15, height: 15) pointMarker.strokeStyle = SCISolidPenStyle(color: .yellow, thickness: 2.0) pointMarker.fillStyle = SCISolidBrushStyle(colorCode: 0xFF0066FF) // Create DataSeries and fill it with some data let dataSeries = SCIXyDataSeries(xType: .double, yType: .double) // Create and add Scatter Series let impulseSeries = SCIFastImpulseRenderableSeries() impulseSeries.dataSeries = dataSeries impulseSeries.pointMarker = pointMarker impulseSeries.strokeStyle = SCISolidPenStyle(color: .yellow, thickness: 1.0) impulseSeries.zeroLineY = 0.2 surface.renderableSeries.add(impulseSeries)
// Assume a surface has been created and configured somewhere IISCIChartSurface surface; // Create a PointMarker instance var pointMarker = new SCIEllipsePointMarker(); pointMarker.Size = new CGSize(15, 15); pointMarker.StrokeStyle = new SCISolidPenStyle(UIColor.Yellow, 2.0f); pointMarker.FillStyle = new SCISolidBrushStyle(0xFF0066FF); // Create DataSeries and fill it with some data var dataSeries = new XyDataSeries(); // Create and add Scatter Series var impulseSeries = new SCIFastLineRenderableSeries(); impulseSeries.DataSeries = dataSeries; impulseSeries.PointMarker = pointMarker; impulseSeries.StrokeStyle = new SCISolidPenStyle(UIColor.Yellow, 1.0f); impulseSeries.ZeroLineY = 0.2; surface.RenderableSeries.Add(impulseSeries);

The result should be:

Impulse Series Type

Impulse Series Features

Impulse Series also has some features similar to other series, such as:

Render a Gap in a Impulse Series

It’s possible to render a Gap in an Impulse series, by passing a data point with a NaN as the Y value. Please refer to the RenderableSeries APIs article for more details.

Specify Color for Individual Bars

In SciChart, you can draw each bar of the Impulse Series with different colors using the PaletteProvider API. To Use palette provider for Impulse Series - a custom ISCIFillPaletteProvider (or ISCIStrokePaletteProvider) has to be provided to the ISCIRenderableSeries.paletteProvider property. Please refer to the PaletteProvider API article for more info.