Radar Chart
Compare one or several series across a handful of measures on spokes that share one value axis.
- Desktop
- Mobile
- Tablet
A radar chart shows one or several series across the same handful of measures, such as weekdays or the areas of a survey. Each row of the data is a spoke, from 12 o'clock clockwise, and the values of a series join into a tinted polygon with a 2 px outline, so the shapes of the series compare at a glance. Rings mark the values of the axis, whose figures stand on pills along the spoke at 12 o'clock, and the names of the spokes stand around the rim. Hover a spoke, or focus the chart and step round with the arrow keys, to read its values in a card that trails beside it.
Installation
pnpm dlx shadcn@4.18.0 add @siteplane/radar-chartComplete the one-time setup first. Registry JSON lists source files and dependencies.
Usage
import { RadarChart } from "@/siteplane/components/radar-chart";
<RadarChart
label="Sessions by weekday"
data={[
{ day: "Mon", sessions: 820 },
{ day: "Tue", sessions: 760 },
{ day: "Wed", sessions: 690 },
{ day: "Thu", sessions: 720 },
{ day: "Fri", sessions: 610 },
]}
x="day"
series={[{ key: "sessions", label: "Sessions" }]}
/>;x names the key of the spoke’s name in each row, and each series names the key of its numbers. The chart is as wide as its container and height pixels tall, 240 by default; the examples set the width on a wrapper.
One series
With a single series, the polygon shows the shape of one measure across the spokes, and no legend is shown. The tooltip names the spoke and its value.
Grid and legend
The grid draws the rings of the value axis as polygons and the spokes from the center to the rim; grid={false} leaves out both, while the pills on the vertical spoke still give the scale. The legend lists the series below the plot and is on by default when there is more than one. A mouse over an entry steps the other series back; it does not toggle series. Set legend={false} when the text around the chart already names the series.
- This quarter
- Last quarter
Formatting and palette
Pass formatValue to write the values on the pills and in the tooltip, here as percentages, and formatX to write the names of the spokes around the rim and in the tooltip heading. A series that names no color takes a shade of the brand color, from strong to light, spread over the number of series. With palette="categorical", each series takes its own chart color instead, --chart-1 to --chart-8, which helps when the polygons overlap. Both palettes start over from the ninth series, and a color on a series always wins.
- Enterprise
- Team
- Starter
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
Radar | readonly ChartDatum[] | required | Rows of the chart, one per spoke from 12 o’clock clockwise: the spoke’s name and one number per series. |
Radar | string | required | Key of the spoke’s name in each row. |
Radar | readonly ChartSeries[] | required | The series to draw, in order. |
Radar | string | required | Accessible name of the chart. |
Radar | string | unset | Id of an element that describes the chart, read after the summary of the data that the chart gives screen readers. |
Radar | number | 240 | Height of the chart in pixels, the legend included; the width follows the container. |
Radar | brand | categorical | brand | brand shades the brand color from strong to light; categorical gives each series its own chart color. A series’ own color wins either way. |
Radar | boolean | true with more than one series | Lists the series below the plot. |
Radar | boolean | true | The rings of the value axis and the spokes. |
Radar | (value: number) => string | locale number (1,234.5); compact on the pills (1.2K) | Formats values in the tooltip and on the pills of the value axis. |
Radar | boolean | false | Rolls the values in the tooltip to the next spoke’s. Off, they change at once. |
Radar | (value: ChartXValue) => string | text as given; a date as Jan 5, and Jan 5, 2026 in the tooltip | Formats the names of the spokes around the rim and in the tooltip heading. |
Radar | string | provider, else en-US | Locale of numbers and dates: the locale of SiteplaneLocaleProvider unless set, and en-US without one, so the server and the browser agree. |
Radar | string | No data | Shown in place of the plot when there is nothing to draw. |
Radar | Partial<CartesianChartLabels> | English words | Replaces the words that the chart gives screen readers for this chart, each one on its own. Translate them once for every chart with the chart messages of SiteplaneLocaleProvider. |
Radar | string | unset | Additional classes on the figure. |
Chart | string | required | Key of the numbers of this series in each row. |
Chart | string | required | Name shown in the legend and the tooltip. |
Chart | string | palette color | A CSS color, such as var(--chart-3), that replaces the palette color of this series. |
Cartesian | string | chart | What screen readers call the chart. |
Cartesian | string | Use the arrow keys to move between data points. | Read after the description of the chart while it is a focus stop. An empty text leaves the hint out. |
Cartesian | string | to | Joins the first and the last spoke in the summary of the data, as in Mon to Sun. |
Cartesian | string | lowest | Comes before the lowest value of each series in the summary. |
Cartesian | string | highest | Comes before the highest value of each series in the summary. |
RadarChartProps exports this contract. ChartDatum, ChartSeries, ChartXValue,
ChartPalette and CartesianChartLabels come from the chart core,
@/siteplane/components/chart, which installs with the chart. The chart renders
a figure with the plot and, for several series, a legend; it takes no native
props or ref beyond className and aria-describedby. The pills of the value
axis are Badge pills, which install with the chart.
negativeColor and type of ChartSeries apply to the Bar Chart only.
Usage notes
Use a radar chart to compare the profile of a few series across three to about ten measures that share one scale, such as scores out of 100 or counts per weekday. When the measures have different units or the order of the spokes means nothing, the shapes mislead; show a Bar Chart or a Table instead. The axis runs from 0 at the center to a round value at the rim and gives a rough scale; the tooltip shows one spoke at a time. A value below 0 or a missing value sits at the center, and a missing value leaves its series out of the tooltip for that spoke.
The plot is one focus stop. On hover, focus or tap, the spoke nearest the pointer by its angle becomes active, and the chart shows:
- a hairline from the center to the rim along the spoke, which turns to the next spoke the short way round;
- a dot per series that glides to its point on that spoke;
- the tooltip card beside the rim, trailing it, with the spoke’s name as its heading and a row per series. The card’s values change to the new ones at once, or roll to them with
rollingNumbers.
Left and Right arrow keys step round the spokes and wrap from the last to the first, Home and End jump to the first and the last spoke, and Escape closes the tooltip. Keyboard focus starts at the spoke at 12 o'clock. A tap or pen press pins the spoke until the next press elsewhere or Escape. Screen readers meet the plot as a chart named by label. Its description sums up the data with the first and the last spoke and the lowest and the highest value of each series; a chart with no value is described by emptyLabel. While the chart is a focus stop, a hint that the arrow keys move between the data points follows the description. labels replaces these words and the role description, for example with their translation. While the keyboard or a tap moves between the spokes, a polite live region reads what the tooltip shows. Each row of the tooltip names its series, so the color never carries the information alone. A chart with no values is not a focus stop.
The chart keeps room around the rim for the names of the spokes and the pill at the top, so long names make the radar smaller; keep them short or give the chart more width. New data glides in when the number of spokes and series stays the same: the polygons and the rings move to the new values together over --motion-duration-value. A change in the number of spokes or series shows at once. The hairline and the dots follow the active spoke over --motion-duration-follow, and the card trails over --motion-duration-follow-trail. All of it is instant under reduced motion: the system setting, html with data-motion-reduce="true" or SiteplaneMotionProvider preset="reduced". The chart draws its plot once it has measured the width of its container. Until then, and in the server HTML, it renders the box of the plot at its full height, the legend and what screen readers read, so nothing on the page moves when the plot appears. The tooltip comes from Tooltip. The chart opens and closes it itself, so it needs no TooltipProvider, which only shares hover delays between tooltips.