Pie Charts
A pie chart displays data as slices of a circle, where each slice represents a proportion of the whole.Basic Pie Chart
Pie Chart Configuration
Key configuration options from~/workspace/source/ts/Series/Pie/PieSeriesDefaults.ts:52-641:
array
default:"[null, null]"
The center of the pie chart relative to the plot area. Can be percentages or pixel values.
number | string
default:"null"
The diameter of the pie relative to the plot area. Can be a percentage or pixel value.
number | string
default:"0"
The size of the inner diameter for the pie. A size greater than 0 renders a donut chart.
number
default:"0"
The start angle of the pie slices in degrees where 0 is top and 90 is right.
number
The end angle of the pie in degrees. Defaults to startAngle plus 360.
number
default:"10"
If a point is sliced, how many pixels should it be moved from the center.
number | string
default:"3"
The corner radius of the border surrounding each slice.
Whether to redraw the pie as if hidden points were null.
Data Labels
Pie charts have extensive data label options:Data Label Alignment
Data Label Alignment
Control how data labels align:
Connector Shape
Connector Shape
Choose from built-in connector shapes:
'crookedLine'(default)'fixedOffset''straight'
Custom Formatter
Custom Formatter
Donut Charts
Donut charts are pie charts with a hollow center, created by settinginnerSize.
Basic Donut Chart
Donut with Custom Center Text
Semi-Circle Donut
Create a gauge-like visualization:Variable Pie
Variable pie charts allow each slice to have a different radius based on a z-value:Styling and Colors
Use Cases
Pie Charts
- Showing market share
- Budget allocation
- Survey results
- Composition of a whole
Donut Charts
- Multiple data series
- Emphasizing total value
- Cleaner appearance
- Adding center labels
Data Formats
Pie charts support two main data formats:- Array of numbers:
data: [29, 71, 106, 129] - Array of objects:
data: [{name: 'Chrome', y: 61.41}, {name: 'Firefox', y: 10.85}]
Pie charts always use
colorByPoint: true by default, giving each slice a different color.