chart

Docs › Chart types

Pie and donut

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

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).

Live example

Code for this example

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] }],
  },
});
OptionDefaultWhat it does
donutHole0.62Hole size as a share of the radius (0–1)
donutLabelthe totalText in the hole; false hides it
otherThreshold0.02Slices under this share (2%) fold into "Other"; 0 keeps every slice
startAngle0Start angle in degrees (0 = 12 o'clock)
legend'right''top' | 'bottom' | 'right' | false