Overview
Pie charts display data as proportional slices of a circle, making them ideal for showing part-to-whole relationships. Each slice represents a category’s contribution to the total.When to Use
Use pie charts when you need to:- Show proportions and percentages of a whole
- Compare parts of a single data series
- Display composition or distribution
- Visualize simple percentage breakdowns (ideally 5-7 categories or fewer)
- Create donut charts with inner radius
Basic Configuration
The pie chart is configured through thePieSeriesOption interface with extensive customization options.
Complete Example
Key Options
The radius of the pie chart. Can be:
- Single value for outer radius:
'50%'or150 - Array
[innerRadius, outerRadius]for donut charts:['40%', '70%']
Center position of the pie chart as
[x, y]. Can use percentage or pixel values.Creates a rose (nightingale) chart where sector angles or areas represent values.
'radius': Sectors have equal angles, different radii'area': Sectors have different angles and areas
Starting angle of the first sector, in degrees. 0° is at 3 o’clock, increases counterclockwise.
Ending angle. Set to a specific value for partial pie charts.
Whether sectors are laid out clockwise.
Minimum angle for a sector (in degrees). Prevents very small slices from being invisible.
If a sector’s angle is less than this value, its label won’t be displayed.
Padding angle between sectors in degrees.
Offset distance when a sector is selected.
Label configuration with pie-specific positioning.
Configuration for the label guide lines.
Visual style of pie sectors with border radius support.
Whether to use a strategy to avoid label overlapping.
Decimal precision for percentage values.
Whether to show the pie when all data values are zero.
Whether to show an empty circle when there’s no data.
Visual emphasis when hovering over sectors.
Data Format
Pie chart data consists of name-value pairs:Advanced Features
Donut Chart
Rose (Nightingale) Chart
Nested Pie Charts
Custom Label Formatting
Callback Data Parameters
Pie charts provide special callback parameters including percentage:Source Reference
The pie chart implementation can be found in:- Series model:
src/chart/pie/PieSeries.ts:148-348 - Default options:
src/chart/pie/PieSeries.ts:219-335 - Type definitions:
src/chart/pie/PieSeries.ts:64-142 - Callback params:
src/chart/pie/PieSeries.ts:60-62