# Pie and donut

> Shares of a whole, with the total in the middle and small slices folded into Other.

Source: https://82chart.com/en/docs/pie-donut/

`type: 'pie'` and `'donut'` use `labels` and the first series. The legend sits on the right; clicking an item takes that slice out and recomputes the rest. The donut hole shows the total (change it with `donutLabel`, or `false` to hide it).

```js
createChart('#chart', {
  type: 'donut',
  title: 'Payment methods',
  prefix: '$',
  data: {
    labels: ['Card', 'Wallet', 'Bank transfer', 'Carrier billing', 'Other'],
    series: [{ name: 'Amount', data: [48200, 31500, 9800, 4100, 600] }],
  },
});
```

| Option | Default | What it does |
| --- | --- | --- |
| `donutHole` | 0.62 | Hole size as a share of the radius (0–1) |
| `donutLabel` | the total | Text in the hole; `false` hides it |
| `otherThreshold` | 0.02 | Slices under this share (2%) fold into "Other"; 0 keeps every slice |
| `startAngle` | 0 | Start angle in degrees (0 = 12 o'clock) |
| `legend` | 'right' | `'top' \| 'bottom' \| 'right' \| false` |

> Past six slices a bar chart reads more accurately: people compare lengths better than angles.
