Pies and doughnuts are used to represent relative proportions of data. These can be drawn using the Pie class; this class can be used to draw both pies and doughnuts.
The following example shows how to use it:
Expand source code
The Pie class
This plot element draws both pie charts and doughnut charts. Whether a pie or a doughnut is drawn depends on the value of the InnerRadius property: if this is [0, 0], a pie is drawn; otherwise, this determines the size of the “hole” and a doughnut is drawn. The Centre of the pie/doughnut is specified in data coordinates (which are then converted by the CoordinateSystem), but also the InnerRadius and OuterRadius are specified as vectors in the data coordinate space. The first and second elements of these arrays specify, respectively, the width and the height of the pie chart. Depending on the values for these and on the coordinate system, the chart may be a perfect circle, or it may be more or less “squished”.