Skip to the page content

Polar area charts

Eleven ways to draw a polar area chart with Chart.js, each one colored by your theme.

11 charts

Trial signups through the year

January at the top, running clockwise, so winter sits at the top.

Seasonal rose
  • Trial signups, 1,765 this year
Show config
data: { labels: months, datasets: [{ data: trialSignups }] },
options: {
  scales: { r: { pointLabels: { display: true, centerPointLabels: true } } },
}

Sales against target by region

The dashed ring is the target. Regions past it are filled in full.

Against a target
  • Reached target
  • Below target
  • Target
Show config
plugins: [{
  afterDatasetsDraw(chart) {
    const r = chart.scales.r;
    const ring = r.getDistanceFromCenterForValue(100);
    chart.ctx.arc(r.xCenter, r.yCenter, ring, 0, Math.PI * 2);
  },
}]

Orders by weekday, August and September

Both on one scale, so a longer slice always means more orders.

Two periods

August

460 orders a week

September

503 orders a week

Show config
// The same max on both charts, or the two can't be compared.
options: { scales: { r: { max: 100, ticks: { stepSize: 50 } } } }

Orders by hour of the day

A 24-hour clock, midnight at the top. Busy hours reach further.

Time of day
Show config
backgroundColor: data.map((v) => tint(color, 0.3 + 0.6 * (v / max))),
scales: { r: { pointLabels: { callback: (label, i) => (i % 6 === 0 ? label : '') } } }

Customers by segment

Width is the share of customers, length is the average order.

Variable sizes
  • Occasional
  • Returning
  • Subscribers
  • Gift buyers
  • Office accounts
Show config
datasets: [{
  data: averageOrder,                       // how long each slice is
  angle: shareOfCustomers.map((p) => p * 3.6), // how wide, in degrees
}]

Accounts by industry

Largest first, clockwise, with names and counts round the edge.

Outside labels
Show config
rows.sort((a, b) => b.units - a.units);
scales: { r: { pointLabels: {
  display: true,
  centerPointLabels: true,
  callback: (label, i) => [label, String(rows[i].accounts)],
} } }

MRR by product

The start angle turns the chart. At −30° Pro sits at the top.

Custom start angle
  • Pro
  • Max
  • Basic
  • Routing
  • SMS credits
  • Portal
Show config
// Degrees, where 0 is straight up and angles run clockwise.
options: { scales: { r: { startAngle: -30 } } }

Deliveries by direction

Last month's 558 deliveries by direction and distance. South leads.

Wind rose
  • Under 3 mi
  • 3 to 10 mi
  • Over 10 mi
Show config
// Each band is a running total, drawn nearest first so it sits on top.
datasets: [near, nearPlusMid, all].map((data, i) => ({ data, label: bands[i] })),
options: { scales: { r: { startAngle: -22.5 } } } // centers N at the top

Where signups come from

Seven channels, so the key becomes a list with the values.

Side legend
  • Search24%
  • Partners19%
  • Email16%
  • Social14%
  • Events11%
  • Content9%
  • Marketplace7%
Show config
// Chart.js can put its own legend on the right...
plugins: { legend: { position: 'right' } }
// ...but an HTML list beside the canvas wraps and can carry values.

Orders a day by city

One color per slice; equal angles, so length carries the value.

Multi-color
  • Eugene
  • Ann Arbor
  • Minot
  • Dubuque
  • Flagstaff
  • Duluth
Show config
const series = [1, 2, 3, 4, 5, 6].map((n) =>
  getComputedStyle(document.documentElement).getPropertyValue('--basalt-series-' + n));
datasets: [{ data, backgroundColor: series }]

Staff by team

One dataset, one color, the defaults left alone.

Basic
Show config
new Chart(canvas, {
  type: 'polarArea',
  data: { labels, datasets: [{ label: 'Staff', data }] },
});