Inherits from UIView
Declared in YLPieChartView.h
YLPieChartView.m

Overview

View that represents a pie chart. All data is supplied via the YLPieChartDataSource protocol.

Tasks

Properties

  •   pieBackgroundColor

    Background color of the pie chart. Default value is white.

    property
  •   pieBorderColor

    Border color of the pie chart. Default value is nil.

    property
  •   innerPieBackgroundColor

    Background color of the inner circle for donut pie charts. Default value is white.

    property
  •   sliceBorderColor

    Border color of a single pie slice. Default value is nil.

    property
  •   selectedSliceBorderColor

    Border color for a selected pie slice. Default value is white.

    property
  •   textColor

    Color of text labels. Default value is white.

    property
  •   textShadowColor

    Shadow color of text labels. Default value is nil.

    property
  •   textFont

    Font of text labels. Default value is bold system font of size 12.

    property
  •   pieBorderWidth

    Border width of the pie chart. Default value is 0.

    property
  •   sliceBorderWidth

    Border width of pie slices. Default value is 0.

    property
  •   selectedSliceBorderWidth

    Border width of selected pie slice. Default is 2.

    property
  •   padding

    Space between the pie chart and the container view. Default value is 10.

    property
  •   selectionOffset

    Amount of offset that should be applied to selected pie slices. This value should be smaller than the padding value! Default value is 8.

    property
  •   innerRadiusOffset

    Amount of offset that should be subtracted from the radius value to calculate the radius of the inner circle. Default value is 0.

    property
  •   startAngle

    Start angle of pie slices in radians. This value should be between 0 and 360 and will be converted to radians internally! Default value is 270 which is the top center point on the circle.

    property
  •   animationDuration

    Duration of the animations.

    property
  •   selectionStyle

    Selection style. Default value is kSelectionStyleOffsetAnimation.

    property
  •   labelStyle

    Text label style. Default value is kLabelStylePercentage.

    property
  •   center

    Center point of the pie chart.

    property
  •   allowsSelection

    Boolean value that indicates whether selection is allowed. Default value is YES.

    property
  •   animateSelection

    Boolean value that indicates whether selections should be animated. Default value is YES.

    property
  •   showTextLabels

    Boolean value that indicates whether text labels on pie slices should be displayed. Default value is YES.

    property
  •   selectedIndex

    Number of the selected index or -1 if there’s no selection.

    property
  •   dataSource

    Reference to the datasource that should be used to request additional information.

    property
  •   delegate

    Reference to the delegate that should be informed.

    property

Initialization

Reload Methods

Pie Slice Methods

Selection Methods

Properties

allowsSelection

Boolean value that indicates whether selection is allowed. Default value is YES.

@property (nonatomic, assign) BOOL allowsSelection

Discussion

Boolean value that indicates whether selection is allowed. Default value is YES.

Declared In

YLPieChartView.h

animateSelection

Boolean value that indicates whether selections should be animated. Default value is YES.

@property (nonatomic, assign) BOOL animateSelection

Discussion

Boolean value that indicates whether selections should be animated. Default value is YES.

Declared In

YLPieChartView.h

animationDuration

Duration of the animations.

@property (nonatomic, assign) CGFloat animationDuration

Discussion

Duration of the animations.

Declared In

YLPieChartView.h

center

Center point of the pie chart.

@property (nonatomic, readonly) CGPoint center

Discussion

Center point of the pie chart.

Declared In

YLPieChartView.h

dataSource

Reference to the datasource that should be used to request additional information.

@property (nonatomic, assign) IBOutlet NSObject<YLPieChartDataSource> *dataSource

Discussion

Reference to the datasource that should be used to request additional information.

Declared In

YLPieChartView.h

delegate

Reference to the delegate that should be informed.

@property (nonatomic, assign) IBOutlet NSObject<YLPieChartDelegate> *delegate

Discussion

Reference to the delegate that should be informed.

Declared In

YLPieChartView.h

innerPieBackgroundColor

Background color of the inner circle for donut pie charts. Default value is white.

@property (nonatomic, retain) UIColor *innerPieBackgroundColor

Discussion

Background color of the inner circle for donut pie charts. Default value is white.

Declared In

YLPieChartView.h

innerRadiusOffset

Amount of offset that should be subtracted from the radius value to calculate the radius of the inner circle. Default value is 0.

@property (nonatomic, assign) NSUInteger innerRadiusOffset

Discussion

Amount of offset that should be subtracted from the radius value to calculate the radius of the inner circle. Default value is 0.

Declared In

YLPieChartView.h

labelStyle

Text label style. Default value is kLabelStylePercentage.

@property (nonatomic, assign) YLPieChartLabelStyle labelStyle

Discussion

Text label style. Default value is kLabelStylePercentage.

Declared In

YLPieChartView.h

padding

Space between the pie chart and the container view. Default value is 10.

@property (nonatomic, assign) NSUInteger padding

Discussion

Space between the pie chart and the container view. Default value is 10.

Declared In

YLPieChartView.h

pieBackgroundColor

Background color of the pie chart. Default value is white.

@property (nonatomic, retain) UIColor *pieBackgroundColor

Discussion

Background color of the pie chart. Default value is white.

Declared In

YLPieChartView.h

pieBorderColor

Border color of the pie chart. Default value is nil.

@property (nonatomic, retain) UIColor *pieBorderColor

Discussion

Border color of the pie chart. Default value is nil.

Declared In

YLPieChartView.h

pieBorderWidth

Border width of the pie chart. Default value is 0.

@property (nonatomic, assign) NSUInteger pieBorderWidth

Discussion

Border width of the pie chart. Default value is 0.

Declared In

YLPieChartView.h

selectedIndex

Number of the selected index or -1 if there’s no selection.

@property (nonatomic, assign) NSInteger selectedIndex

Discussion

Number of the selected index or -1 if there’s no selection.

Declared In

YLPieChartView.h

selectedSliceBorderColor

Border color for a selected pie slice. Default value is white.

@property (nonatomic, retain) UIColor *selectedSliceBorderColor

Discussion

Border color for a selected pie slice. Default value is white.

Declared In

YLPieChartView.h

selectedSliceBorderWidth

Border width of selected pie slice. Default is 2.

@property (nonatomic, assign) NSUInteger selectedSliceBorderWidth

Discussion

Border width of selected pie slice. Default is 2.

Declared In

YLPieChartView.h

selectionOffset

Amount of offset that should be applied to selected pie slices. This value should be smaller than the padding value! Default value is 8.

@property (nonatomic, assign) NSUInteger selectionOffset

Discussion

Amount of offset that should be applied to selected pie slices. This value should be smaller than the padding value! Default value is 8.

Declared In

YLPieChartView.h

selectionStyle

Selection style. Default value is kSelectionStyleOffsetAnimation.

@property (nonatomic, assign) YLPieChartSelectionStyle selectionStyle

Discussion

Selection style. Default value is kSelectionStyleOffsetAnimation.

Declared In

YLPieChartView.h

showTextLabels

Boolean value that indicates whether text labels on pie slices should be displayed. Default value is YES.

@property (nonatomic, assign) BOOL showTextLabels

Discussion

Boolean value that indicates whether text labels on pie slices should be displayed. Default value is YES.

Declared In

YLPieChartView.h

sliceBorderColor

Border color of a single pie slice. Default value is nil.

@property (nonatomic, retain) UIColor *sliceBorderColor

Discussion

Border color of a single pie slice. Default value is nil.

Declared In

YLPieChartView.h

sliceBorderWidth

Border width of pie slices. Default value is 0.

@property (nonatomic, assign) NSUInteger sliceBorderWidth

Discussion

Border width of pie slices. Default value is 0.

Declared In

YLPieChartView.h

startAngle

Start angle of pie slices in radians. This value should be between 0 and 360 and will be converted to radians internally! Default value is 270 which is the top center point on the circle.

@property (nonatomic, assign) CGFloat startAngle

Discussion

Start angle of pie slices in radians. This value should be between 0 and 360 and will be converted to radians internally! Default value is 270 which is the top center point on the circle.

Declared In

YLPieChartView.h

textColor

Color of text labels. Default value is white.

@property (nonatomic, retain) UIColor *textColor

Discussion

Color of text labels. Default value is white.

Declared In

YLPieChartView.h

textFont

Font of text labels. Default value is bold system font of size 12.

@property (nonatomic, retain) UIFont *textFont

Discussion

Font of text labels. Default value is bold system font of size 12.

Declared In

YLPieChartView.h

textShadowColor

Shadow color of text labels. Default value is nil.

@property (nonatomic, retain) UIColor *textShadowColor

Discussion

Shadow color of text labels. Default value is nil.

Declared In

YLPieChartView.h

Instance Methods

deselectSliceAtIndex:animated:

Deselects a pie slice.

- (void)deselectSliceAtIndex:(NSInteger)index animated:(BOOL)animated

Parameters

index

The pie slice index.

animated

Boolean value that indicates whether deselection should be animated.

Discussion

Deselects a pie slice.

Declared In

YLPieChartView.h

initWithFrame:

Initializes a YLPieChartView object and returns it to the caller.

- (id)initWithFrame:(CGRect)frame

Parameters

frame

Frame of the pie chart view.

Return Value

An initialized YLPieChartView instance.

Discussion

Initializes a YLPieChartView object and returns it to the caller.

Declared In

YLPieChartView.h

normalizedValueForSliceAtIndex:

Returns the normalized value for a specific pie slice. This value is between 0.0 and 1.0.

- (CGFloat)normalizedValueForSliceAtIndex:(NSInteger)index

Parameters

index

The pie slice index.

Return Value

Value between 0.0 and 1.0.

Discussion

Returns the normalized value for a specific pie slice. This value is between 0.0 and 1.0.

Declared In

YLPieChartView.h

reloadData

Reloads the pie chart animated.

- (void)reloadData

Discussion

Reloads the pie chart animated.

Declared In

YLPieChartView.h

reloadDataAnimated:

Reloads the pie chart.

- (void)reloadDataAnimated:(BOOL)animated

Parameters

animated

Boolean value that indicates whether the pie chart should be reloaded animated.

Discussion

Reloads the pie chart.

Declared In

YLPieChartView.h

selectSliceAtIndex:animated:

Selects a pie slice.

- (void)selectSliceAtIndex:(NSInteger)index animated:(BOOL)animated

Parameters

index

The pie slice index.

animated

Boolean value that indicates whether selection should be animated.

Discussion

Selects a pie slice.

Declared In

YLPieChartView.h