SChartBubbleSeries Class Reference

Inherits from SChartPointSeries : SChartCartesianSeries : SChartMappedSeries : SChartSeries : NSObject
Declared in SChartBubbleSeries.h
Availability
Related samples

Overview

SChartBubbleSeries is a type of SChartSeries that uses its data points to construct a bubble series.

This type of series focuses on allowing bubble sizes to be controlled via the use of data point objects of type SChartBubbleDataPoint. As such this series ignores attempts to set the size/radius of its data points in any other way.

The size of the bubbles in this series are independent of any axes that the series might be linked to. This makes the concept of a scale that alters the size of all bubbles in the series useful. You can supply your own scale or let the series be scaled via an auto-calculated value such that the largest bubble in the series matches some chosen diameter (see biggestBubbleDiameterForAutoScaling).

This series has the corresponding series and point styles SChartBubbleSeriesStyle and SChartBubblePointStyle respectively.

Properties

biggestBubbleDiameterForAutoScaling

This property is used to calculate an appropriate autoscale that results in the biggest bubble in the series being [biggestBubbleDiameterForAutoScaling doubleValue] points in diameter.

@property (nonatomic, retain, nullable) NSNumber *biggestBubbleDiameterForAutoScaling

Discussion

If this property is nil then a default value of half of the current smallest canvas dimension will be used instead.

By default, this property is set to nil.

Declared In

SChartBubbleSeries.h

scale

The value that will be used to scale the rendered bubbles for this series.

@property (nonatomic, retain, nullable) NSNumber *scale

Discussion

A value of nil will result in the series auto-calculating an appropriate scale to use. The auto-calculated scale is based on biggestBubbleDiameterForAutoScaling.

By default, this property is set to nil.

Declared In

SChartBubbleSeries.h

Instance Methods

currentScale

Returns the current scale being used to render the bubble series.

- (nullable NSNumber *)currentScale

Discussion

If you have set scale then this will be returned, otherwise an automatically calculated scale will be returned.

Note that if no scale has been set and no auto-caulculated value exists that nil will be returned.

Declared In

SChartBubbleSeries.h

selectedStyle

Manages the appearance of the bubble series when it is selected.

- (SChartBubbleSeriesStyle *)selectedStyle

Discussion

Style settings in this object will be applied when the series is marked as selected (or a point is selected).

The default settings of the style are inherited from the chart theme. You can tweak the appearance of the series by modifying the style.

Declared In

SChartBubbleSeries.h

setSelectedStyle:

Sets the style object for the bubble series when it is selected.

- (void)setSelectedStyle:(SChartBubbleSeriesStyle *)selectedStyle

Parameters

selectedStyle

The new style object to use.

See Also

Declared In

SChartBubbleSeries.h

setStyle:

Sets the style object for the bubble series.

- (void)setStyle:(SChartBubbleSeriesStyle *)style

Parameters

style

The new style object to use for the bubble series.

See Also

Declared In

SChartBubbleSeries.h

style

Manages the appearance of the bubble series on the chart.

- (SChartBubbleSeriesStyle *)style

Discussion

The default settings of the style are inherited from the chart theme. You can tweak the appearance of the series by modifying the style.

Declared In

SChartBubbleSeries.h

styleForPoint:

Specifies the style to use on a per-point basis

- (SChartBubblePointStyle *)styleForPoint:(id<SChartData>)point

Parameters

point

The data-point that will be styled by the returned style object.

Discussion

This method is called for each datapoint in this series and the standard implementation chooses to return either the style or selectedStyle object based on the selectionMode and selected state of either the point or the series. Computationally expensive operations here will increase initial render time.

Use the sChartXValue & sChartYValue properties to access each datapoint’s X & Y values. Here is an example of how to use these properties to style each point:

 - (SChartBubblePointStyle*)styleForPoint:(idSChartData)point {

     SChartBubblePointStyle *newStyle = [super styleForPoint:point];

     float yValue = [[point sChartYValue] floatValue];

     if (yValue > 90) {
         newStyle.color = [UIColor redColor];
     } else if(yValue > 50) {
         newStyle.color = [UIColor yellowColor];
     } else {
         newStyle.color = [UIColor greenColor];
     }
     return newStyle;
 }

Declared In

SChartBubbleSeries.h