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.jsonRelease quality scores
RadarChartRadarTabledefaultRadarChartLabels- +1 more
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
import { ChartCard } from "@/components/sheenui/charts/chart-parts/chart-card";
import { ChartTable } from "@/components/sheenui/charts/chart-parts/empty-table";
import { seriesLegend } from "@/components/sheenui/charts/chart-parts/legend-tooltip";
import { type ChartSeries } from "@/components/sheenui/charts/chart-utils";
import { RadarChart } from "@/components/sheenui/charts/radar-chart";
// Package build (after the first npm release, or a packed tarball): import { ChartCard, seriesLegend, ChartTable, RadarChart, type ChartSeries } from "@sheenui/theme";
const data = [
{ metric: "Performance", previous: 84, current: 95 },
{ metric: "Accessibility", previous: 93, current: 97 },
{ metric: "Reliability", previous: 88, current: 93 },
{ metric: "Security", previous: 79, current: 86 },
{ metric: "Test coverage", previous: 71, current: 83 },
{ metric: "Docs", previous: 62, current: 80 },
];
const series: ChartSeries[] = [
{ key: "previous", label: "Last release", color: 2 },
{ key: "current", label: "This release", color: 1 },
];
<ChartCard
title="Release scorecard"
legend={seriesLegend(series, "rect")}
table={<ChartTable data={data} index="metric" indexLabel="Measure" series={series} />}
>
<RadarChart
data={data}
index="metric"
series={series}
max={100}
aria-label="Release quality scores, this release against the last"
/>
</ChartCard>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.tsxcomponents/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.tslib/{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
import { type ChartSeries } from "@/components/sheenui/charts/chart-utils";
import { RadarChart } from "@/components/sheenui/charts/radar-chart";
// Package build (after the first npm release, or a packed tarball): import { RadarChart, type ChartSeries } from "@sheenui/theme";
const support = [
{ area: "First response time", team: 82, benchmark: 70 },
{ area: "Resolution time", team: 64, benchmark: 72 },
{ area: "Customer satisfaction", team: 91, benchmark: 80 },
{ area: "Reopened tickets", team: 58, benchmark: 66 },
{ area: "Self-service deflection", team: 47, benchmark: 55 },
{ area: "Escalation rate", team: 73, benchmark: 61 },
];
const series: ChartSeries[] = [
{ key: "team", label: "Our team", color: 1 },
{ key: "benchmark", label: "Industry benchmark", color: 3 },
];
export function Example() {
return (
<RadarChart
data={support}
index="area"
series={series}
max={100}
aria-label="Support quality against the 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
import { type ChartSeries } from "@/components/sheenui/charts/chart-utils";
import { RadarChart } from "@/components/sheenui/charts/radar-chart";
// Package build (after the first npm release, or a packed tarball): import { RadarChart, type ChartSeries } from "@sheenui/theme";
const roasts = [
{ note: "Acidity", ethiopia: 8.5, colombia: 6, sumatra: 3.5 },
{ note: "Sweetness", ethiopia: 7, colombia: 7.5, sumatra: 5 },
{ note: "Body", ethiopia: 4.5, colombia: 6.5, sumatra: 8.5 },
{ note: "Bitterness", ethiopia: 3, colombia: 5, sumatra: 7 },
{ note: "Aroma", ethiopia: 9, colombia: 7, sumatra: 6.5 },
];
const series: ChartSeries[] = [
{ key: "ethiopia", label: "Ethiopia", color: 2 },
{ key: "colombia", label: "Colombia", color: 3 },
{ key: "sumatra", label: "Sumatra", color: 1 },
];
export function Example() {
return (
<RadarChart
grid="circle"
data={roasts}
index="note"
series={series}
max={10}
aria-label="Flavor profile of three single-origin coffees"
/>
);
}Props
RadarChartLabels keys and English defaults (2)
RadarTable props
ChartTableLabels keys and English defaults (2)
Keyboard
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
Related pages
48 charts pages in all: browse them on Charts.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .