Inherits from UIView
Declared in IGPieChartView.h

Overview

This class represents the pie chart view.

The pie chart view is a data visualization tool that displays a circular graph containing sectors (slices). Pie chart data is a collection of numeric values, and each slice represents one value. Small values that fall below a user-defined threshold are grouped into the Others slice.

The pie chart view supports multiple slice selection and explosion, as well as tooltips, rotation, tap and long press gestures.

Tasks

Other Methods

  •   delegate

    Sets the IGPieChartViewDelegate for the pie chart view.

    property
  •   dataSource

    Sets the data source for the pie chart view. This can be an interface that conforms to IGPieChartViewDataSource protocol or an instance of IGPieChartViewDataSourceHelper.

    property
  •   dataPoints

    Returns an array of IGCategoryPoint objects. (read-only)

    property
  •   allowSliceExplosion

    Determines whether exploded slices appear exploded or not. When set to false, this property disables all visual cues that indicate that a slice is exploded. All exploded slices will appear as not exploded. Once this property is set to true, any slices that are marked as exploded will visually appear as exploded. Changing the value of this property has no effect on the explodedSlices property.

    property
  •   allowSliceSelection

    Determines whether selected slices appear as selected or not. When set to false, this property disables all visual cues that indicate that a slice is selected. All selected slices will appear as not selected. Once this property is set to true, any slices that are marked as selected will visually appear as selected. Changing the value of this property has no effect on the selectedSlices property.

    property
  •   brushes

    An array of IGBrush objects that are used to color the pie slices. This array takes precedence over themes.

    property
  •   outlines

    An array of IGBrush objects that are used to color the slice outlines. This array takes precedence over themes.

    property
  •   explodedRadius

    Determines how far away the tip of the slice is from the origin.

    property
  •   font

    Determines the font used by the pie chart labels. This is the default font for the labels of the slices that are not selected. Selected labels and the others label have their own font properties.

    property
  •   fontBrush

    Determines the font brush used by the pie char labels. This is the default font brush for the labels of the slices that are not selected. Selected labels and the others label have their own font brush properties.

    property
  •   innerExtent

    Determines the amount of white space in the center of the chart. This property can be used to create an empty ring in the middle of the pie chart and make it look like a doughnut chart. The value of this property should be set between 0 and 1.

    property
  •   labelExtent

    Determines how far the labels are displayed from the slices.

    property
  •   labelsPosition

    Determines where in the pie chart the labels are displayed.

    property
  •   isLeaderLineVisible

    Determines if the line from the slice to the label is visible.

    property
  •   leaderLineBrush

    The brush of the leader line.

    property
  •   leaderLineThickness

    The thickness of the leader line.

    property
  •   legend

    Associates an item legend with the pie chart.

    property
  •   othersCategoryText

    Text displayed for the Others slice. The value is “Others” by default.

    property
  •   othersCategoryThreshold

    Determines how small a value has to be in order to be grouped into the Others slice.

    property
  •   othersCategoryType

    This property is used along with othersCategoryThreshold to group slices into the Others slice. When set to IGOthersCategoryTypeNumber the value is directly compared with the threshold. When set to IGOthersCategoryTypePercent the comparison is made between the threshold and the value expressed as the percentage of the total.

    property
  •   radiusFactor

    Determines the length of the pie radius.

    property
  •   selectedSlices

    An index collection of selected sliced.

    property
  •   explodedSlices

    An index collection of exploded sliced.

    property
  •   startAngle

    Determines the start angle of the pie chart.

    property
  •   sweepDirection

    Determines whether the pie chart is clockwise or counter clockwise.

    property
  •   theme

    This property can be used to apply a theme to a pie chart.

    property
  •   tooltipPinLocation

    Specifies the tooltip location.

    property
  •   selectedBrush

    The fill brush of the selected slice.

    property
  •   selectedOutline

    The outline brush of the selected slice.

    property
  •   selectedLabelBrush

    The label brush of the selected slice.

    property
  •   selectedStrokeThickness

    The stroke thickness of the selected slice.

    property
  •   selectedLabelFont

    The label font of the selected slice.

    property
  •   othersCategoryBrush

    The fill brush of the Others slice.

    property
  •   othersCategoryOutline

    The outline brush of the Others slice.

    property
  •   othersCategoryLabelBrush

    The label brush of the Others slice.

    property
  •   othersCategoryStrokeThickness

    The stroke thickness of the Others slice.

    property
  •   othersCategoryLabelFont

    The label font of the Others slice.

    property
  •   renderingQuality

    Determines the rendering quality of the chart. This property only affects retina displays. By default, the chart will render with high quality. If the chart contains too many data points and its performance begins to degrade due to a high number of shapes, setting a lower rendering quality will increase the performance.

    property

Configuring the pie chart view

Notifying the pie chart view of data source changes

Properties

allowSliceExplosion

Determines whether exploded slices appear exploded or not. When set to false, this property disables all visual cues that indicate that a slice is exploded. All exploded slices will appear as not exploded. Once this property is set to true, any slices that are marked as exploded will visually appear as exploded. Changing the value of this property has no effect on the explodedSlices property.

@property (nonatomic) BOOL allowSliceExplosion

Declared In

IGPieChartView.h

allowSliceSelection

Determines whether selected slices appear as selected or not. When set to false, this property disables all visual cues that indicate that a slice is selected. All selected slices will appear as not selected. Once this property is set to true, any slices that are marked as selected will visually appear as selected. Changing the value of this property has no effect on the selectedSlices property.

@property (nonatomic) BOOL allowSliceSelection

Declared In

IGPieChartView.h

brushes

An array of IGBrush objects that are used to color the pie slices. This array takes precedence over themes.

@property (nonatomic, retain) NSArray *brushes

Declared In

IGPieChartView.h

dataPoints

Returns an array of IGCategoryPoint objects. (read-only)

@property (nonatomic, readonly) NSMutableArray *dataPoints

Declared In

IGPieChartView.h

dataSource

Sets the data source for the pie chart view. This can be an interface that conforms to IGPieChartViewDataSource protocol or an instance of IGPieChartViewDataSourceHelper.

@property (nonatomic, assign) id<> dataSource

Declared In

IGPieChartView.h

delegate

Sets the IGPieChartViewDelegate for the pie chart view.

@property (nonatomic, assign) id<> delegate

Declared In

IGPieChartView.h

explodedRadius

Determines how far away the tip of the slice is from the origin.

@property (nonatomic) float explodedRadius

Discussion

This property will typically have a value between 0 and 1, where 0 would put the slice at the origin and 1 would put the tip of the slice at a distance equal to the pie’s radius.

Declared In

IGPieChartView.h

explodedSlices

An index collection of exploded sliced.

@property (nonatomic, retain) NSIndexSet *explodedSlices

Discussion

This property contains a set of indices that represent the exploded slices. For example, a set of {0,1,3} means that the first, second and fourth slices are exploded.

Declared In

IGPieChartView.h

font

Determines the font used by the pie chart labels. This is the default font for the labels of the slices that are not selected. Selected labels and the others label have their own font properties.

@property (nonatomic, retain) UIFont *font

Declared In

IGPieChartView.h

fontBrush

Determines the font brush used by the pie char labels. This is the default font brush for the labels of the slices that are not selected. Selected labels and the others label have their own font brush properties.

@property (nonatomic, retain) IGBrush *fontBrush

Declared In

IGPieChartView.h

innerExtent

Determines the amount of white space in the center of the chart. This property can be used to create an empty ring in the middle of the pie chart and make it look like a doughnut chart. The value of this property should be set between 0 and 1.

@property (nonatomic) float innerExtent

Declared In

IGPieChartView.h

isLeaderLineVisible

Determines if the line from the slice to the label is visible.

@property (nonatomic) BOOL isLeaderLineVisible

Declared In

IGPieChartView.h

labelExtent

Determines how far the labels are displayed from the slices.

@property (nonatomic) float labelExtent

Declared In

IGPieChartView.h

labelsPosition

Determines where in the pie chart the labels are displayed.

@property (nonatomic) IGLabelsPosition labelsPosition

Discussion

This property can be used to determine the positioning of the labels. Labels can be positioned in the center of the slices, inside the slices towards the outher arc, outside the slices or using best fit approach. This property can also hide the labels by setting it to IGLabelsPositionNone.

Declared In

IGPieChartView.h

leaderLineBrush

The brush of the leader line.

@property (nonatomic, retain) IGBrush *leaderLineBrush

Declared In

IGPieChartView.h

leaderLineThickness

The thickness of the leader line.

@property (nonatomic) float leaderLineThickness

Declared In

IGPieChartView.h

legend

Associates an item legend with the pie chart.

@property (nonatomic, assign) IGLegend *legend

Declared In

IGPieChartView.h

othersCategoryBrush

The fill brush of the Others slice.

@property (nonatomic, retain) IGBrush *othersCategoryBrush

Declared In

IGPieChartView.h

othersCategoryLabelBrush

The label brush of the Others slice.

@property (nonatomic, retain) IGBrush *othersCategoryLabelBrush

Declared In

IGPieChartView.h

othersCategoryLabelFont

The label font of the Others slice.

@property (nonatomic, retain) UIFont *othersCategoryLabelFont

Declared In

IGPieChartView.h

othersCategoryOutline

The outline brush of the Others slice.

@property (nonatomic, retain) IGBrush *othersCategoryOutline

Declared In

IGPieChartView.h

othersCategoryStrokeThickness

The stroke thickness of the Others slice.

@property (nonatomic) float othersCategoryStrokeThickness

Declared In

IGPieChartView.h

othersCategoryText

Text displayed for the Others slice. The value is “Others” by default.

@property (nonatomic, retain) NSString *othersCategoryText

Declared In

IGPieChartView.h

othersCategoryThreshold

Determines how small a value has to be in order to be grouped into the Others slice.

@property (nonatomic) float othersCategoryThreshold

Declared In

IGPieChartView.h

othersCategoryType

This property is used along with othersCategoryThreshold to group slices into the Others slice. When set to IGOthersCategoryTypeNumber the value is directly compared with the threshold. When set to IGOthersCategoryTypePercent the comparison is made between the threshold and the value expressed as the percentage of the total.

@property (nonatomic) IGOthersCategoryType othersCategoryType

Declared In

IGPieChartView.h

outlines

An array of IGBrush objects that are used to color the slice outlines. This array takes precedence over themes.

@property (nonatomic, retain) NSArray *outlines

Declared In

IGPieChartView.h

radiusFactor

Determines the length of the pie radius.

@property (nonatomic) float radiusFactor

Discussion

The value of this property is multiplied by the length of the radius to produce the final radius.

Declared In

IGPieChartView.h

renderingQuality

Determines the rendering quality of the chart. This property only affects retina displays. By default, the chart will render with high quality. If the chart contains too many data points and its performance begins to degrade due to a high number of shapes, setting a lower rendering quality will increase the performance.

@property (nonatomic) IGRenderingQuality renderingQuality

Declared In

IGPieChartView.h

selectedBrush

The fill brush of the selected slice.

@property (nonatomic, retain) IGBrush *selectedBrush

Declared In

IGPieChartView.h

selectedLabelBrush

The label brush of the selected slice.

@property (nonatomic, retain) IGBrush *selectedLabelBrush

Declared In

IGPieChartView.h

selectedLabelFont

The label font of the selected slice.

@property (nonatomic, retain) UIFont *selectedLabelFont

Declared In

IGPieChartView.h

selectedOutline

The outline brush of the selected slice.

@property (nonatomic, retain) IGBrush *selectedOutline

Declared In

IGPieChartView.h

selectedSlices

An index collection of selected sliced.

@property (nonatomic, retain) NSIndexSet *selectedSlices

Discussion

This property contains a set of indices that represent the selected slices. For example, a set of {0,1,3} means that the first, second and fourth slices are selected.

Declared In

IGPieChartView.h

selectedStrokeThickness

The stroke thickness of the selected slice.

@property (nonatomic) float selectedStrokeThickness

Declared In

IGPieChartView.h

startAngle

Determines the start angle of the pie chart.

@property (nonatomic) float startAngle

Discussion

This property determines the starting position of the first slice in the pie chart. The value of 0, which is the default value, starts the first slice at 3 o'clock.

Declared In

IGPieChartView.h

sweepDirection

Determines whether the pie chart is clockwise or counter clockwise.

@property (nonatomic) IGSweepDirection sweepDirection

Declared In

IGPieChartView.h

theme

This property can be used to apply a theme to a pie chart.

@property (nonatomic) IGPieChartThemeDefinition *theme

Discussion

This can be a pre-defined or a custom theme. Pre-defined themes can be used by setting this property to one of the themes in IGPieChartDefaultThemes interface.

Declared In

IGPieChartView.h

tooltipPinLocation

Specifies the tooltip location.

@property (nonatomic) IGTooltipPinLocation tooltipPinLocation

Discussion

This property determines where the tooltip will be positioned. The default setting uses a floating tooltip, which follows the location of the long press. Tooltip can also be pinned to top, bottom, left, or right.

Declared In

IGPieChartView.h

Instance Methods

clearItemsForDataSource:

Notifies the chart view that all items in the data source were cleared.

- (void)clearItemsForDataSource:(id<IGPieChartViewDataSource>)source

Parameters

source

Data source that had its items removed.

Discussion

This method is used to tell the chart view that all of the items in a given data source have been removed.

Declared In

IGPieChartView.h

exportVisualData

Returns a data representation of the visuals of the pie chart.

- (VisualPieChartData *)exportVisualData

Discussion

This method is available to provide a way to do validation for testing of the visuals of the pie chart.

Declared In

IGPieChartView.h

insertItemAtIndex:withSource:

Notifies the chart view that an item has been inserted in the data source.

- (void)insertItemAtIndex:(int)index withSource:(id<IGPieChartViewDataSource>)source

Parameters

index

Index of an item that has been inserted.

source

Data source that had an item inserted.

Discussion

This method is used to tell the chart view that an item has been inserted into a given data source at a given index.

Declared In

IGPieChartView.h

removeItemAtIndex:withSource:

Notifies the chart view that an item has been removed from the data source.

- (void)removeItemAtIndex:(int)index withSource:(id<IGPieChartViewDataSource>)source

Parameters

index

Index of an item that has been removed.

source

Data source that had an item removed.

Discussion

This method is used to tell the chart view that an item has been removed from a given data source at a given index.

Declared In

IGPieChartView.h

replaceItemAtIndex:withSource:

Notifies the chart view that an item has been replaced in the data source.

- (void)replaceItemAtIndex:(int)index withSource:(id<IGPieChartViewDataSource>)source

Parameters

index

Index of an item that has been replaced.

source

Data source that had an item replaced.

Discussion

This method is used to tell the chart view that an item has been replaced in a given data source at a given index.

Declared In

IGPieChartView.h

updateItemAtIndex:withSource:

Notifies the chart view that an item has been updated in the data source.

- (void)updateItemAtIndex:(int)index withSource:(id<IGPieChartViewDataSource>)source

Parameters

index

Index of an item that has been replaced.

source

Data source that had an item replaced.

Discussion

This method is used to tell the chart view that an item has been updated in a given data source at a given index.

Declared In

IGPieChartView.h