--- url: https://chartbuddy.io/embed/docs/chart-types/pie.md --- > Docs index: [llms.txt](https://chartbuddy.io/embed/docs/llms.txt) # Pie / donut Share of a single total across categories. A donut is a pie with a hole. ## Identity | | | |---|---| | `chartType` | `pie` · `donut` | | Option bag | `pie` | | `seriesData` layout | `categoryValue` – columns `[Category, Value]` | | Min grid | 2 rows × 2 columns | | Orientation | N/A – axes disabled | | Sample | [Pie](https://chartbuddy.io/embed/docs/samples/pie.md) | *** ## Minimal `chartData` ```js { chartType: 'pie', seriesData: [ ['Category', 'Value'], ['North', 45], ['South', 30], ['West', 25], ], title: { visible: true, text: 'Share' }, subtitle: { visible: false, text: '' }, } ``` *** ## `seriesData` ```js [ ['Category', 'Value'], ['North', 45], ['South', 30], ['West', 25], ] ``` | Rule | Detail | |---|---| | Layout | `categoryValue` – not series-rows | | Transpose | Do not use bar/line `isDataTransposed: true` patterns here | | One measure | One value column | Shared layout rules: [chartData schema · seriesData](https://chartbuddy.io/embed/docs/api/chart-data.md#seriesdata-layouts). *** ## Option bag: `pie` | Field | Default (new charts) | Role | |---|---|---| | `innerRadiusRatio` | `0` for `pie`; **`0.5` for `donut`** | Hole size, `0–1` (`0` = full pie) | | `scaleFactor` | `0.9` | Overall pie scale inside the plot | | `labelVisibilityThreshold` | `0` | Hide tiny-slice labels below this share | | `explode` | `[]` | Per-slice explode offsets | | `line` | white stroke defaults | Slice border color / width / dash | | `seriesStrokes` / widths / dash | `[]` | Per-slice stroke chrome | | `overrides` | `{}` | Indexed style patches | ### Donut Ask for `'donut'` – the hole is already open. You do **not** need to set `innerRadiusRatio` unless you want a different size: ```js { chartType: 'donut', seriesData: [['Category', 'Value'], ['North', 45], ['South', 30]], } // Override hole only when needed: { chartType: 'donut', pie: { innerRadiusRatio: 0.7 } } ``` `getChartData()` returns `chartType: 'pie'` with `innerRadiusRatio: 0.5`. That round-trips correctly. *** ## Axes & scales Axes are **disabled** for pie / donut. Do not author `axes` for layout. Labels live in pie / series-label chrome. Details: [Axes · by chart type](https://chartbuddy.io/embed/docs/axes/by-chart-type.md). *** ## Type-specific behaviour * Slice colors: `legend.colors`. * Series labels default more visible on pie/donut than on bar/line. * Prefer editor placement + `getChartData()` for label leader lines and explode. *** ## Pitfalls * Feeding a bar/line `seriesRows` grid into pie * Putting options in `bar` / `line` on a pie (`foreign-option-bag`) * Expecting `getChartData()` to keep `chartType: 'donut'` — it returns `pie` with the hole set * Setting `innerRadiusRatio: 5` (must be `0–1` – validation throws) *** ## Related * [chartData schema](https://chartbuddy.io/embed/docs/api/chart-data.md) · [Legend](https://chartbuddy.io/embed/docs/configuration/legend.md) * Sample: [Pie](https://chartbuddy.io/embed/docs/samples/pie.md)