Skip to content

Polar Area Chart for React

A React polar area chart, Nightingale's rose, draws one wedge per category around a circle, its area proportional to the value. Pass data as readonly ChartRow[]: one row per wedge.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/polar-area-chart.json

Causes of mortality, 1854–55

  • Preventable disease
  • Wounds
  • Other causes
Use the arrow keys to read each wedge.

  • PolarAreaChart
  • PolarAreaTable
  • foldPolarSeries
  • polarAreaLegend
  • defaultPolarAreaChartLabels
  • +3 more

Nightingale's rose, 1854–55

Her own data: most soldiers died of preventable disease, not wounds. Areas are true to the values; switch to radius scaling to see how it would exaggerate the winter.

Causes of mortality in the army in the East

Deaths per month from April 1854 to March 1855, by cause

  • Preventable disease
  • Wounds
  • Other causes

Files to copy

15 folders · 33 files · 4 packages
From theme/src/
  • components/charts/{polar-area-chart.tsx, category-bar.tsx, chart-export-menu.tsx, chart-export.ts, chart-figure.tsx, chart-fit.tsx, chart-icons.tsx, chart-parts.tsx, chart-patterns.tsx, chart-pointer.tsx, chart-tip.tsx, chart-utils.ts, heatmap.tsx}
  • components/button/
  • components/charts/category-bar/
  • components/charts/chart-parts/
  • components/charts/heatmap/
  • components/drawer/parts/sheet.tsx
  • components/kbd/
  • components/menu/
  • components/skeleton/
  • components/spinner/
  • components/status-icons/
  • hooks/{use-controllable.ts, use-direction.ts, use-intersection.ts, use-latest.ts, use-magnetic.ts, use-media-query.ts, use-preferences.ts}
  • motion/{gate.ts, tokens.ts}
  • lib/{cn.ts, csv.ts, form.ts, glide-highlight.tsx, heading.ts, math.ts, popup-a11y.ts, popup-motion.ts, state-light.tsx, warn-once.ts}
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/polar-area-chart.jsonRegistry item: polar-area-chart. The styles need the Tailwind v4 glass UI setup.
Packages
pnpm add @base-ui/react clsx motion tailwind-merge

Next.js: samples here pass functions (formatters, seriesLegend, a dashboard's load), so put them in a file that starts with "use client".

24 hours of traffic

One series, one hue: position and name tell the wedges apart. With 24 names around the rose, labels thin out on narrow screens instead of colliding.

Sessions by hour

Average weekday, local time

Props

PropTypeDefaultDescription
data (required)readonly ChartRow[]NoneOne row per wedge (e.g. per month), clockwise from 12 o'clock.
index (required)stringNoneKey of the wedge's name in each row.
series (required)readonly ChartSeries[]NoneOne or more series; several stack outwards (Nightingale's rose). Up to 8, each with a fixed color slot.
scale"area" | "radius""area""area" (default): a wedge's AREA is proportional to its value, which is how a rose must be read. "radius": its length is, which exaggerates large values; only for familiar 0–100 scores.
heightnumber340Height in px; the rose is as large as fits.
format((n: number) => string)formatCompact in localeFormats a value for the labels, tooltips and data table: takes the number, returns the text shown.
localestring"en"Locale of the default number format.
emptyStateReactNodeNoneShown when there is nothing to plot.
labelsPartial<PolarAreaChartLabels>defaultPolarAreaChartLabelsEvery other string, for translation: labels={{ instructions: "…" }}; omitted keys keep the English of defaultPolarAreaChartLabels. All 5 keys of PolarAreaChartLabels are listed in the key table under the props table.
aria-label (required)stringNoneAccessible summary of what the chart shows.
classNamestringNoneAdds extra classes to the outer element.
PolarAreaChartLabels keys and English defaults (5)
Pass any key in labels; the rest keep the defaults of defaultPolarAreaChartLabels.
KeyEnglish default
instructionsUse the arrow keys to read each wedge.
totalTotal
otherOther
touchHintTap or drag around the chart to read values
emptyNo data

PolarAreaTable props

PropTypeDefaultDescription
data (required)readonly ChartRow[]NoneOne row per wedge (e.g. per month), clockwise from 12 o'clock.
format((n: number) => string)formatCompact in localeFormats a value for the labels, tooltips and data table: takes the number, returns the text shown.
labelsPartial<PolarAreaChartLabels>defaultPolarAreaChartLabelsEvery other string, for translation: labels={{ instructions: "…" }}; omitted keys keep the English of defaultPolarAreaChartLabels. All 5 keys of PolarAreaChartLabels are listed in the key table under the props table.
localestring"en"Locale of the default number format.
index (required)stringNoneKey of the wedge's name in each row.
series (required)readonly ChartSeries[]NoneOne or more series; several stack outwards (Nightingale's rose). Up to 8, each with a fixed color slot.
indexLabelstringNoneSets the header of the first column.
captionstringNoneHidden caption that names the table for screen readers.

Keyboard

KeysAction
TabFocus the chart (one tab stop).
→/↓Next wedge, clockwise.
←/↑Previous wedge.
Home/EndFirst / last wedge.
EscapeStop reading.

Accessibility

  • The chart is one focusable figure; each wedge read by keyboard announces every series' value (and the total) once.
  • Areas are true to the values by default, so the picture never exaggerates big wedges; the ring values give the scale.
  • Names around the rose thin out instead of colliding, and every wedge is in the table view, so nothing depends on reading a crowded label.
  • Forced colors outline every wedge in CanvasText; reduced motion draws the rose in place.

All exports on this page

  • PolarAreaChart — Nightingale's rose: one wedge per category around a circle (months, hours, compass points), each wedge's area proportional to its value.
  • PolarAreaTable — One row per wedge, one column per series, plus the total when there are several.
  • defaultPolarAreaChartLabels — The built-in English strings of PolarAreaChart; spread it into your own labels and change what you need.
  • foldPolarSeries — More than 8 series: the first 7 keep their slots and the rest are summed into one "Other" series (neutral grey), so colour slots never repeat.
  • polarAreaLegend — Legend for a rose: one swatch per series (skip it for a single series: the title names it).

When to use the polar area chart

  • Use it as a Nightingale rose (coxcomb) chart for cyclical categories such as months, hours of the day or compass points, where wedge position carries meaning and a circle makes the cycle obvious.
  • It recreates Nightingale's rose: several series, such as causes of mortality per month, stack outward while each wedge's area stays proportional to its value.
  • It suits a 24-hour traffic profile with one series and one hue, where wedge position and name identify the hour and labels thin out on narrow screens.
  • Skip it when readers need to compare exact values across categories; a BarChart is easier to read, and RadarChart fits comparing profiles across several unrelated measures.
  • Pair it with ChartCard for the title and Chart / Table tabs, PolarAreaTable for exact numbers, and polarAreaLegend when several series stack outward in the same wedge.

Frequently asked questions

48 charts pages in all: browse them on Charts.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .