A simple pie chart component that allows you to show quarts drawn pie charts using either an array of values or a delegate protocol.
If the radius for the pie is not supplied it will automatically scale to fit within the supplied frame.
Selection of slices can be either single selection or multi-selection. The offset from the pie center to distinguish the selection is customizable.
Slice colors are optional and will be automatically generated based on a "base" color if omitted on any element.
Currently there is no support for legends, but the text part of the slice is supported in the interface.
Sorry, but this is a non ARC component for now.
Holds the base color that will be used for slice color generation when a color is not supplied for a slice.
Holds the text color that will be used to show the selected unit to display.
Controls what will be shown on the pie slices if anything. Can be one of the following:
If the inner radius is set the pie chart will be drawn as a donut where the inner radius specifies the radius of the hole in the donut.
Sets the offset from the center point at which a selected slice will be drawn.
Indicates if more than one slice can be selected.
Default initialization. Will calculate maximum radius to fit within the frame.
Optional initialization where center point within the frame and the radius can be supplied.
Add a number of slices with values supplied in an array.
Add a slice with a given value.
Add a slice with a given value and text.
Add a slice with a given value and color.
Add a slice with a given value, text and color.
Select the slice at the given index. Make sure that the selectedOffset property is set.
Drop the IWantPieChart.h and IWantPieChart.c files into your project. Include the IWantPieChart.h in the view/controller that will use it.
Create and initialize the chart using [[IWantPieChart alloc] initWithFrame:frame]
Add one or more slices using addSliceWithValue or addSlices:WithValue.
All done, further configuration is optional.