|Inherits from||SChartRadialSeries : SChartSeries : NSObject|
SChartDonutSeries displays magnitude data on the chart - the larger the value of the data point, the larger the slice representing that data point.
A donut series contains an instance of
SChartDonutSeriesStyle, which manages its appearance.
When a slice is selected in the chart, it protrudes out of the donut, and rotates to a given position. You can set the amount of protrusion which a selected slice has by setting the
[SChartDonutSeriesStyle protrusion] property on the series
selectedStyle. You can set the position it rotates to using the
selectedPosition property. The series contains an instance of
SChartAnimation which describes the motion of the slice as it rotates to its selected position. See
selectionAnimation for more information.
You can enable panning on a donut series. If panning is enabled, performing a swipe gesture on the series will cause it to rotate. Whether panning is enabled is controlled by the
gesturePanningEnabled property. By default this is set to
Legends on donut charts show an entry for each data point, or slice, of the donut series.
The direction in which data is drawn around the centre of the plot.
@property (nonatomic) SChartRadialSeriesDrawDirection drawDirection
This defaults to
Defines whether or not panning is enabled on this series.
@property (nonatomic) BOOL gesturePanningEnabled
If panning is enabled, performing a swipe gesture on the series will cause it to rotate.
The series will stay under your finger whilst your finger remains on the series. Once you lift your finger, the series will begin to decelerate. The
rotationFriction property controls the rate at which the series will decelerate.
The default value for this property is
The inner radius of the series, in points.
@property (nonatomic) CGFloat innerRadius
A format string to use for the labels which annotate data within a radial series.
@property (nonatomic, retain) NSString *labelFormatString
This defaults to @“%.2f”
The outer radius of the series, in points.
@property (nonatomic) CGFloat outerRadius
The current rotation of the series, in radians.
@property (nonatomic) CGFloat rotation
The amount of friction applied to this pie series after a rotation (pan) gesture finishes, and the series begins to decelerate.
@property (nonatomic) CGFloat rotationFriction
The friction is defined as the percentage of decay of velocity per frame. The default value is 0.02, or 2%.
The angle to which the slice will rotate once selected, in radians.
@property (nonatomic, retain) NSNumber *selectedPosition
An animation object describing the motion of the donut series when a slice is selected.
@property (nonatomic, retain) SChartAnimation *selectionAnimation
angleCurve of the animation describes any rotation of the series from its current position to its selected position.
radiusCurve describes the animation of any increase or decrease in the protrusion of the slice as a result of being selected or deselected.
The time taken for ‘selectionAnimation’ to complete, in seconds.
@property (nonatomic, assign) CGFloat selectionAnimationDuration
Default is 1.
By default, tapping on a radial series during panning will just stop the pan. If this property is enabled, tapping on a slice in the series will select that slice. This property defaults to
@property (nonatomic, assign) BOOL selectionEnabledDuringPanning
If this property is enabled, and
selectedPosition is not set to a value, the donut series will keep spinning whilst a slice moves out. The same is true for the case where a slice moves in once it is deselected.
Returns the center of the donut, within the chart frame.
Returns the center of the slice at a given index, within the chart frame.
The index of the slice in which we are interested.
Returns the index of the slice in the donut series which is at the given angle in radians.
The angle in radians at which we wish to find the donut slice.
Rotates the specified slice to the specified angle in radians, with the provided animation.
- (void)rotateSliceAtIndex:(NSInteger)index toAngle:(double)rads withAnimation:(SChartAnimation *)animation
The index of the slice in the series to rotate.
The angle to which to rotate the specified slice, in radians.
The animation to use during the rotation.
Manages the appearance of the donut series when it is selected.
- (SChartDonutSeriesStyle *)selectedStyle
Style settings in this object will be applied when the series is marked as selected (or a slice is selected).
Sets the style object for the scatter series when it is selected.
- (void)setSelectedStyle:(SChartDonutSeriesStyle *)selectedStyle
The new style object to use.
Select or deselect a slice within the series.
- (void)setSlice:(NSInteger)sliceIndex asSelected:(BOOL)sel
The index of the slice in the series to select or deselect.
YES if we are selecting the slice.
Set a spoke’s style for a specific slice.
- (void)setSpokeStyle:(SChartSpokeStyle *)spokeStyle forSpokeAtSliceIndex:(NSInteger)sliceIndex
The style defining the spoke’s attributes for the next draw cycle
The slice index of the spoke the style should apply to
This enables spokes to be styled individually on a slice-by-slice basis.
SChartSpokeStyle conforms to NSCopying, therefore custom styles can use the
series' default or selected spoke styles as a foundation for any alterations.
Any changes made to the spoke’s style will be overriden following the next draw cycle. The recommended method to set per-slice spoke styles is in SChartDelegate’s sChart:alterLabel:forDatapoint:atSliceIndex:inRadialSeries:
Sets the style object for the donut series.
- (void)setStyle:(SChartDonutSeriesStyle *)style
The new style object to use for the donut series.
Manages the appearance of the donut series on the chart.
- (SChartDonutSeriesStyle *)style
The default settings of the style are inherited from the chart theme. You can tweak the appearance of the series by modifying the style.