Inherits from UIView
Conforms to YLPieChartDataSource
YLPieChartDelegate
Declared in YLPieSliceChartView.h
YLPieSliceChartView.m

Overview

This view uses YLPieChartView internally to show a single pie slice chart view. Use this view instead of YLPieChartView if you want to display a single value only in the pie chart.

Tasks

Properties

Instance Methods

Other Methods

Properties

pieChartView

Reference to the internally used YLPieChartView instance.

@property (nonatomic, readonly) YLPieChartView *pieChartView

Discussion

Reference to the internally used YLPieChartView instance.

Declared In

YLPieSliceChartView.h

sliceColor

Color of the pie slice.

@property (nonatomic, retain) UIColor *sliceColor

Discussion

Color of the pie slice.

Declared In

YLPieSliceChartView.h

sliceValue

Normalized value of the pie slice. This value should be between 0.0 and 1.0!

@property (nonatomic, assign) CGFloat sliceValue

Discussion

Normalized value of the pie slice. This value should be between 0.0 and 1.0!

Declared In

YLPieSliceChartView.h

Instance Methods

numberOfSlicesInPieChartView:

Return the number of slices in the pie chart.

- (NSUInteger)numberOfSlicesInPieChartView:(YLPieChartView *)pieChartView

Parameters

pieChartView

The YLPieChartView instance.

Return Value

Number of slices in the pie chart.

Discussion

Return the number of slices in the pie chart.

Declared In

YLPieChartDataSource.h

pieChartView:colorForSliceAtIndex:

Return the color that should be used for a specific pie slice. If you return nil or don’t implement this method YLPieChartView will auto-generate a color.

- (UIColor *)pieChartView:(YLPieChartView *)pieChartView colorForSliceAtIndex:(NSUInteger)index

Parameters

pieChartView

The YLPieChartView instance.

index

The pie slice index.

Return Value

Color for the pie slice.

Discussion

Return the color that should be used for a specific pie slice. If you return nil or don’t implement this method YLPieChartView will auto-generate a color.

Declared In

YLPieChartDataSource.h

pieChartView:valueForSliceAtIndex:

Return the value for a specific pie slice. You don’t need to worry about normalized values since YLPieChartView will normalize the values internally while drawing the pie chart.

- (CGFloat)pieChartView:(YLPieChartView *)pieChartView valueForSliceAtIndex:(NSUInteger)index

Parameters

pieChartView

The YLPieChartView instance.

index

The pie slice index.

Return Value

Value for the pie slice.

Discussion

Return the value for a specific pie slice. You don’t need to worry about normalized values since YLPieChartView will normalize the values internally while drawing the pie chart.

Declared In

YLPieChartDataSource.h

reloadDataAnimated:

Call this method to reflect property changes.

- (void)reloadDataAnimated:(BOOL)animated

Parameters

animated

YES if you want to reload the pie chart animated.

Discussion

Call this method to reflect property changes.

Declared In

YLPieSliceChartView.h

showSingleSliceInPieChartView:

Return YES if you only want to display a single pie slice. Have a look at YLPieSliceChartView how this is used.

- (BOOL)showSingleSliceInPieChartView:(YLPieChartView *)pieChartView

Parameters

pieChartView

The YLPieChartView instance.

Return Value

Boolean value that indicates wether only a single pie slice will be displayed.

Discussion

Return YES if you only want to display a single pie slice. Have a look at YLPieSliceChartView how this is used.

Declared In

YLPieChartDataSource.h