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
{
"$schema": "https://openpresentation.org/schema/opf/v1",
"name": "Market Share — Q1 2026",
"slides": [
{
"layout": "chart-1x-title-center",
"title": "Market Share — Q1 2026",
"chart": {
"type": "pie",
"data": {
"columns": [
"Series",
"Our Product",
"Competitor A",
"Competitor B",
"Others"
],
"rows": [
[
"Share",
35,
28,
22,
15
]
]
}
},
"design": {
"titleAlignment": "center",
"contentAlignment": "center"
}
}
],
"catalogs": {
"layouts": {
"records": [
{
"$schema": "https://openpresentation.org/schema/opf-layout/v1",
"id": "chart-1x-title-center",
"name": "Chart 1x Title Center",
"placeholders": [
{
"type": "title"
},
{
"type": "chart"
}
]
}
]
}
}
}
Example: Budget Allocation Doughnut
{
"$schema": "https://openpresentation.org/schema/opf/v1",
"name": "2026 Budget Allocation",
"slides": [
{
"layout": "chart-1x-title-center",
"title": "2026 Budget Allocation",
"chart": {
"type": "doughnut",
"data": {
"columns": [
"Series",
"Engineering",
"Sales",
"Marketing",
"Operations",
"G&A"
],
"rows": [
[
"Budget %",
40,
25,
15,
12,
8
]
]
}
},
"design": {
"titleAlignment": "center",
"contentAlignment": "center"
}
}
],
"catalogs": {
"layouts": {
"records": [
{
"$schema": "https://openpresentation.org/schema/opf-layout/v1",
"id": "chart-1x-title-center",
"name": "Chart 1x Title Center",
"placeholders": [
{
"type": "title"
},
{
"type": "chart"
}
]
}
]
}
}
}
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