SChartDonutSeriesStyle Class Reference

Inherits from SChartSeriesStyle : NSObject
Declared in SChartDonutSeriesStyle.h
Availability Standard
Premium
Related samples PieChart

Overview

SChartDonutSeriesStyle manages the appearance of donut series on a ShinobiChart. The API for donut series is defined in SChartDonutSeries.

Donut slices (and also pie slices, as SChartPieSeriesStyle inherits its behavior from this class) are made up of an outline (or ‘crust’) and a filled area (or ‘flavour’). This style object allows you to manage the following properties of a donut series:

  • The color and thickness of the crust around the slices. You can also configure whether the crust is shown. See showCrust, crustThickness and crustColors for more information.
  • The fill colors of the slices, and whether slices are filled at all. See showFlavour and flavourColors for more information.

When a donut series is drawn, it calls the crustColorAtIndex: and flavourColorAtIndex: methods on the style to get the crust and flavour colors for each slice.

You can configure whether labels are drawn on a donut series. By default, they will be. The labels annotate each slice in the series. See showLabels, labelFont, labelFontColor and labelBackgroundColor for more information.

When a slice in a donut series is selected, it protrudes out from the rest of the series. You can control how much it protrudes using the protrusion property.

Tasks

General properties

Spoke methods and properties

Slice properties

Protrusion

Labels

Update style

Series colors

Properties

chartEffect

The appearance of the series, which can be either flat, bevelled, or rounded.

@property (nonatomic) SChartRadialChartEffect chartEffect

Discussion

The complete list of options is:

  • SChartRadialChartEffectFlat: Configures the appearance of the series to be flat.
  • SChartRadialChartEffectBevelled: Configures the appearance of the series to be bevelled.
  • SChartRadialChartEffectBevelledLight: Configures the appearance of the series to be bevelled. Has the same shadowing applied as the normal effect but the the shadow color is lighter.
  • SChartRadialChartEffectRounded: Configures the appearance of the series to be rounded.
  • SChartRadialChartEffectRoundedLight: Configures the appearance of the series to be rounded. Has the same shadowing applied as the normal effect but the the shadow color is lighter.
  • SChartRadialChartEffectChiselled: Configures the appearance of the series to be chiselled.
  • SChartRadialChartEffectDefault: Is provided for backwards compatibility. It will be removed in future releases.

In iOS7, the flat effect is the default. In earlier versions of iOS, the chiselled effect is the default.

Declared In

SChartDonutSeriesStyle.h

crustColors

An array containing the ‘crust’ colors of the slices in the series.

@property (nonatomic, retain) NSMutableArray *crustColors

Discussion

The order of the colors in the array corresponds to the order of the slices in the series.

Declared In

SChartDonutSeriesStyle.h

crustThickness

The thickness of the outline or ‘crust’ of the series, in points.

@property (nonatomic, strong, nullable) NSNumber *crustThickness

Declared In

SChartDonutSeriesStyle.h

flavourColors

An array containing the ‘flavour’ colors of the slices in the series.

@property (nonatomic, retain) NSMutableArray *flavourColors

Discussion

The order of the colors in the array corresponds to the order of the slices in the series.

Declared In

SChartDonutSeriesStyle.h

initialRotation

The initial rotation of the series in radians.

@property (nonatomic, strong, nullable) NSNumber *initialRotation

Declared In

SChartDonutSeriesStyle.h

labelBackgroundColor

The background color of the labels which annotate the series.

@property (nonatomic, strong, nullable) UIColor *labelBackgroundColor

Declared In

SChartDonutSeriesStyle.h

labelFont

The font used in the labels which annotate the series.

@property (nonatomic, strong, nullable) UIFont *labelFont

Declared In

SChartDonutSeriesStyle.h

labelFontColor

The font color used in the labels which annotate the series.

@property (nonatomic, strong, nullable) UIColor *labelFontColor

Declared In

SChartDonutSeriesStyle.h

protrusion

The amount by which the slice slides out from the centre when selected, in points.

@property (nonatomic) CGFloat protrusion

Discussion

A zero value means that no protrusion effect is seen when a slice is selected.

Declared In

SChartDonutSeriesStyle.h

showCrust

Defines whether the outline or ‘crust’ of the donut is to be shown.

@property (nonatomic) BOOL showCrust

Declared In

SChartDonutSeriesStyle.h

showFlavour

Defines whether the inside of the donut is filled or ‘flavoured’.

@property (nonatomic) BOOL showFlavour

Declared In

SChartDonutSeriesStyle.h

showLabels

Defines whether the slices of the series are annotated with labels.

@property (nonatomic) BOOL showLabels

Declared In

SChartDonutSeriesStyle.h

spokeStyle

Styling for spoke lines

@property (nonatomic, retain) SChartSpokeStyle *spokeStyle

Declared In

SChartDonutSeriesStyle.h

Instance Methods

crustColorAtIndex:

Returns the outline or ‘crust’ color for the given slice in the series.

- (UIColor *)crustColorAtIndex:(NSInteger)index

Parameters

index

The index of the slice in the series for which to get the crust color.

Declared In

SChartDonutSeriesStyle.h

flavourColorAtIndex:

Returns the fill or ‘flavour’ color for the given slice in the series.

- (UIColor *)flavourColorAtIndex:(NSInteger)index

Parameters

index

The index of the slice in the series for which to get the flavor color.

Declared In

SChartDonutSeriesStyle.h

supplementStyleFromStyle:

Updates this style object using the settings from the passed-in style.

- (void)supplementStyleFromStyle:(SChartDonutSeriesStyle *)style

Parameters

style

The style with which to configure this style object.

Declared In

SChartDonutSeriesStyle.h