Skip to content

Radar Chart for React

A React radar chart, also called a spider chart, compares a few profiles across the same set of measures. Pass data as readonly ChartRow[]: one row per axis (spoke), clockwise from the top.

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

Release quality scores

Use arrow keys to read each axis.

Two series, morphing data

Two series on a 0–100 scale. Switch the quarter: the shapes morph to the new values instead of redrawing. Focus the chart and use the arrow keys to walk the axes.

Release scorecard

Quality audit, Q3, out of 100 points

  • Last release
  • This release

Files to copy

11 folders · 26 files · 4 packages
From theme/src/
  • components/charts/{radar-chart.tsx, chart-export-menu.tsx, chart-export.ts, chart-figure.tsx, chart-fit.tsx, chart-icons.tsx, chart-parts.tsx, chart-patterns.tsx, chart-utils.ts, range-area-chart.tsx}
  • components/charts/chart-parts/
  • components/drawer/parts/sheet.tsx
  • components/kbd/
  • components/menu/
  • components/skeleton/
  • components/status-icons/
  • hooks/{use-controllable.ts, use-intersection.ts, use-latest.ts, use-media-query.ts, use-preferences.ts}
  • motion/tokens.ts
  • lib/{cn.ts, csv.ts, form.ts, glide-highlight.tsx, heading.ts, math.ts, popup-a11y.ts, popup-motion.ts, warn-once.ts}
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/radar-chart.jsonRegistry item: radar-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".

Long axis names

Ten axes with long names in a half-width card. Names are measured in the chart's font, and long ones wrap onto two lines. Only when a name truly can't fit is it shortened, and only the ones that limit the shape, never below eight letters. On a small screen every other name may step back and reappear while its axis is active. Full names stay in the tooltip and the table.

Support quality

Percentile, last 90 days

  • Our team
  • Industry benchmark

Round grid, three series

grid="circle" draws round rings. The scale tops out at a round number above the largest value unless you pass max.

Flavor profile

Cupping scores out of 10

  • Ethiopia
  • Colombia
  • Sumatra

Props

PropTypeDefaultDescription
data (required)readonly ChartRow[]NoneOne row per axis (spoke), clockwise from the top, e.g. { skill: "Speed", alice: 82, bob: 64 }. 3–10 axes read best.
index (required)stringNoneKey of the axis name in each row.
series (required)readonly ChartSeries[]NoneThe shapes to compare: 1–4 series, each with a fixed color slot.
maxnumbera round number at or above the largest valueValue at the outer ring (e.g. 100 for scores).
grid"circle" | "polygon""polygon""polygon" rings follow the spokes; "circle" rings are round.
heightnumber320Largest height (px). When the width is the limit (a narrow card), the chart shrinks to the height its rings and labels need, so there is no empty band above and below the shape.
format((n: number) => string)formatCompactFormats values in the tooltip and the ring labels. Values below 0 are drawn at the centre.
emptyStateReactNodeNoneShown when there is nothing to plot.
patternsbooleantrue when series.length > 3Tell series apart without colour (hatch fills and dashed outlines; the first series stays solid).
labelsPartial<RadarChartLabels>defaultRadarChartLabelsEvery other string, for translation: labels={{ instructions: "…" }}; omitted keys keep the English of defaultRadarChartLabels. All 2 keys of RadarChartLabels 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.
RadarChartLabels keys and English defaults (2)
Pass any key in labels; the rest keep the defaults of defaultRadarChartLabels.
KeyEnglish default
instructionsUse arrow keys to read each axis.
touchHintTap an axis to read its values

RadarTable props

PropTypeDefaultDescription
data (required)readonly ChartRow[]NoneThe rows to show: one object per row, holding the index key and one number per series key.
index (required)stringNoneThe key in each row that names the row, such as "month". It becomes the first column.
series (required)readonly CompareSeries[]NoneSeries to list as columns; one with a compareKey also gets a previous-period column.
format((n: number) => string)formatCompactFormats each number in the table cells.
indexLabelstringNoneHeader of the first column; the index key when left out.
captionstringNoneVisually hidden caption naming the table for screen readers.
labelsPartial<ChartTableLabels>defaultChartTableLabelsText for i18n (defaults come from the enclosing ChartCard's labels, else English). Every other string, for translation: labels={{ noData: "…" }}; omitted keys keep the English of defaultChartTableLabels. All 2 keys of ChartTableLabels are listed in the key table under the props table.
ChartTableLabels keys and English defaults (2)
Pass any key in labels; the rest keep the defaults of defaultChartTableLabels.
KeyEnglish default
noDataNo data
previous(label: string) => `${label} (previous)`

Keyboard

KeysAction
TabFocus the chart. It is one tab stop; the arrow keys then read it.
Arrow keysMove between axes.
Home/EndJump to the first / last axis.
EscapeClear the reading.

Accessibility

  • Keyboard and screen-reader users get a single focusable figure labelled by the chart title, with a short reading hint as its description; inside a ChartCard with a table view, aria-details links it to the table. Every value read is announced politely, once. Each move announces the axis and every series' value.
  • RadarTable is the table view (the same table as ChartTable): pass it as the ChartCard table prop. The Chart / Table tabs put every value in text, so none depends on color.
  • Reduced motion: the polygons appear at their final shape and data changes jump instead of morphing.

All exports on this page

  • RadarChart — A radar (spider) chart: one axis per category, one polygon per series.
  • RadarTable — The table view of a RadarChart: one row per axis, one column per series.
  • defaultRadarChartLabels — The built-in English strings of RadarChart; spread it into your own labels and change what you need.

When to use the radar chart

  • Use it as a spider chart for a release scorecard that compares two quarters across the same quality measures, such as reliability, performance and docs, on one 0 to 100 scale.
  • It suits comparing candidate or product profiles across 3 to 10 attributes, like a flavor profile with cupping scores out of 10 for three coffees.
  • It works in a half-width card with long axis names, because names are measured in the chart's font and wrap onto two lines before being shortened.
  • Skip it when you have more than four series or axes on different scales; a grouped BarChart or a Heatmap compares many items more reliably.
  • Pair it with ChartCard and its table prop, a RadarTable for the text view, and seriesLegend so each shape has a named color.

Frequently asked questions

48 charts pages in all: browse them on Charts.

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