Overview
Pie and doughnut charts show how parts relate to a whole. The pptx.dev API supports both — use PIE for traditional pie charts and DOUGHNUT for the modern ring variant.
Chart Types
| Chart type | Description |
|---|---|
PIE |
Traditional pie chart — slices of a circle |
DOUGHNUT |
Ring chart — same data, hollow center |
Example: Market Share Pie Chart
{
"layout": "chart-1x-title-center",
"content": {
"heading": "Market Share — Q1 2026",
"chart": {
"type": "PIE",
"categories": ["Our Product", "Competitor A", "Competitor B", "Others"],
"series": [
{ "name": "Share", "values": [35, 28, 22, 15] }
]
}
}
}
Example: Budget Allocation Doughnut
{
"layout": "chart-1x-title-center",
"content": {
"heading": "2026 Budget Allocation",
"chart": {
"type": "DOUGHNUT",
"categories": ["Engineering", "Sales", "Marketing", "Operations", "G&A"],
"series": [
{ "name": "Budget %", "values": [40, 25, 15, 12, 8] }
]
}
}
}
Pie vs. Doughnut
Both display the same data. Choose based on aesthetics:
- Pie — classic, universally understood. Good for audiences unfamiliar with data visualization.
- Doughnut — modern, less visual weight. The hollow center can be used for a summary number in print designs.
Best Practices
- Limit to 5-6 segments. More than that makes the chart hard to read. Group small segments into "Others."
- Order slices by size. Largest segment first (clockwise from 12 o'clock) helps scanning.
- Use meaningful labels. "Engineering — 40%" is better than just "40%."
- Avoid pie charts for close values. If all segments are similar sizes, use a bar chart instead — it is easier to compare.
When Not to Use Pie/Doughnut
| Situation | Better alternative |
|---|---|
| Comparing exact values | Column or bar chart |
| Showing trends over time | Line chart |
| More than 6 categories | Stacked bar or treemap |
| All segments are similar sizes | Bar chart |
Next Steps
- Explore column and bar charts for comparisons
- Try specialty charts like treemap and funnel
- See all chart types