iOS Charting Documentation - SciChart iOS Charts SDK v3.x

The Bubble Series Type

Bubble Chart is provided by the SCIFastBubbleRenderableSeries class. It accepts data (X, Y, Z) from a SCIXyzDataSeries and renders a bubble at each [X, Y] with Z bubble scale.

NOTE: For more info about SCIXyzDataSeries, as well as other DataSeries types in SciChart, see the DataSeries API article.

Bubble Series Type

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

The SCIFastBubbleRenderableSeries class allows to specify BubbleBrush and Stroke via the following properties:

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

Also, you can control bubbles scaling using the following properties:

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 a Bubble Series

To create a Bubble Series, use the following code:

// Assume a surface has been created and configured somewhere id<ISCIChartSurface> surface; // Create DataSeries and fill it with some data SCIXyDataSeries *dataSeries = [[SCIXyzDataSeries alloc] initWithXType:SCIDataType_Double yType:SCIDataType_Double]; // Create and add Mountain Series id<ISCIRenderableSeries> bubbleSeries = [SCIFastBubbleRenderableSeries new]; bubbleSeries.dataSeries = dataSeries; bubbleSeries.bubbleBrushStyle = [[SCISolidBrushStyle alloc] initWithColorCode:0x50CCCCCC]; bubbleSeries.strokeStyle = [[SCISolidPenStyle alloc] initWithColorCode:0xFFCCCCCC thickness:1.0]; bubbleSeries.zScaleFactor = 1.0; bubbleSeries.autoZRange = NO; [surface.renderableSeries add:bubbleSeries];
// Assume a surface has been created and configured somewhere let surface: ISCIChartSurface // Create DataSeries and fill it with some data let dataSeries = SCIXyzDataSeries(xType: .double, yType: .double) // Create and add Mountain Series let bubbleSeries = SCIFastBubbleRenderableSeries() bubbleSeries.dataSeries = dataSeries bubbleSeries.bubbleBrushStyle = SCISolidBrushStyle(colorCode: 0x50CCCCCC) bubbleSeries.strokeStyle = SCISolidPenStyle(colorCode: 0xFFCCCCCC, thickness: 2.0) bubbleSeries.zScaleFactor = 1.0 bubbleSeries.autoZRange = false surface.renderableSeries.add(bubbleSeries)
// Assume a surface has been created and configured somewhere IISCIChartSurface surface; // Create DataSeries and fill it with some data var dataSeries = new XyzDataSeries(); // Create and add Mountain Series var bubbleSeries = new SCIFastBubbleRenderableSeries(); bubbleSeries.DataSeries = dataSeries; bubbleSeries.BubbleBrushStyle = new SCISolidBrushStyle(0x50CCCCCC); bubbleSeries.StrokeStyle = new SCISolidPenStyle(0xFFCCCCCC, 2f); bubbleSeries.ZScaleFactor = 1; bubbleSeries.AutoZRange = false; surface.RenderableSeries.Add(bubbleSeries);

Bubble Series Features

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

Render a Gap in a Bubble Series

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

Paint Bubbles with Different Colors

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