Siteplane UI

Radar Chart

Compare one or several series across a handful of measures on spokes that share one value axis.

Markdown
Mon to Sun. Desktop: lowest 190, highest 820. Mobile: lowest 410, highest 720. Tablet: lowest 160, highest 390.
  • Desktop
  • Mobile
  • Tablet
"use client";

import { RadarChart } from "@/siteplane/components/radar-chart";

const sessions = [
  { day: "Mon", desktop: 820, mobile: 410, tablet: 160 },
  { day: "Tue", desktop: 760, mobile: 530, tablet: 210 },
  { day: "Wed", desktop: 690, mobile: 480, tablet: 190 },
  { day: "Thu", desktop: 720, mobile: 560, tablet: 240 },
  { day: "Fri", desktop: 610, mobile: 640, tablet: 280 },
  { day: "Sat", desktop: 240, mobile: 720, tablet: 350 },
  { day: "Sun", desktop: 190, mobile: 680, tablet: 390 },
];

const series = [
  { key: "desktop", label: "Desktop" },
  { key: "mobile", label: "Mobile" },
  { key: "tablet", label: "Tablet" },
];

export default function Example() {
  return (
    <div className="w-full max-w-xl">
      <RadarChart
        data={sessions}
        height={360}
        label="Sessions by device and weekday"
        series={series}
        x="day"
      />
    </div>
  );
}

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-chart

Complete 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.

Mon to Sun. Tickets: lowest 38, highest 148.
"use client";

import { RadarChart } from "@/siteplane/components/radar-chart";

const tickets = [
  { day: "Mon", tickets: 148 },
  { day: "Tue", tickets: 132 },
  { day: "Wed", tickets: 121 },
  { day: "Thu", tickets: 117 },
  { day: "Fri", tickets: 96 },
  { day: "Sat", tickets: 38 },
  { day: "Sun", tickets: 45 },
];

const series = [{ key: "tickets", label: "Tickets" }];

export default function Example() {
  return (
    <div className="w-full max-w-xl">
      <RadarChart
        data={tickets}
        height={320}
        label="Support tickets by weekday"
        series={series}
        x="day"
      />
    </div>
  );
}

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.

Speed to Docs. This quarter: lowest 64, highest 91. Last quarter: lowest 58, highest 81.
  • This quarter
  • Last quarter
"use client";

import { RadarChart } from "@/siteplane/components/radar-chart";

const scores = [
  { area: "Speed", current: 72, previous: 58 },
  { area: "Reliability", current: 88, previous: 81 },
  { area: "Ease of use", current: 79, previous: 74 },
  { area: "Support", current: 91, previous: 69 },
  { area: "Pricing", current: 64, previous: 66 },
  { area: "Docs", current: 83, previous: 61 },
];

const series = [
  { key: "current", label: "This quarter" },
  { key: "previous", label: "Last quarter" },
];

export default function Example() {
  return (
    <div className="w-full max-w-xl">
      <RadarChart
        data={scores}
        grid={false}
        height={360}
        label="Customer survey scores by area"
        series={series}
        x="area"
      />
    </div>
  );
}

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.

Dashboards to Exports. Enterprise: lowest 69%, highest 94%. Team: lowest 31%, highest 86%. Starter: lowest 9%, highest 71%.
  • Enterprise
  • Team
  • Starter
"use client";

import { RadarChart } from "@/siteplane/components/radar-chart";

const adoption = [
  { feature: "Dashboards", enterprise: 0.94, starter: 0.71, team: 0.86 },
  { feature: "Reports", enterprise: 0.88, starter: 0.42, team: 0.73 },
  { feature: "Alerts", enterprise: 0.76, starter: 0.35, team: 0.58 },
  { feature: "Integrations", enterprise: 0.82, starter: 0.18, team: 0.47 },
  { feature: "API", enterprise: 0.69, starter: 0.09, team: 0.31 },
  { feature: "Exports", enterprise: 0.91, starter: 0.54, team: 0.77 },
];

const series = [
  { key: "enterprise", label: "Enterprise" },
  { key: "team", label: "Team" },
  { key: "starter", label: "Starter" },
];

const percent = new Intl.NumberFormat("en-US", {
  maximumFractionDigits: 0,
  style: "percent",
});

export default function Example() {
  return (
    <div className="w-full max-w-xl">
      <RadarChart
        data={adoption}
        formatValue={(value) => percent.format(value)}
        height={360}
        label="Accounts using each feature, by plan"
        palette="categorical"
        series={series}
        x="feature"
      />
    </div>
  );
}

API reference

Component properties
PropTypeDefaultDescription
RadarChart.datareadonly ChartDatum[]requiredRows of the chart, one per spoke from 12 o’clock clockwise: the spoke’s name and one number per series.
RadarChart.xstringrequiredKey of the spoke’s name in each row.
RadarChart.seriesreadonly ChartSeries[]requiredThe series to draw, in order.
RadarChart.labelstringrequiredAccessible name of the chart.
RadarChart.aria-describedbystringunsetId of an element that describes the chart, read after the summary of the data that the chart gives screen readers.
RadarChart.heightnumber240Height of the chart in pixels, the legend included; the width follows the container.
RadarChart.palettebrand | categoricalbrandbrand shades the brand color from strong to light; categorical gives each series its own chart color. A series’ own color wins either way.
RadarChart.legendbooleantrue with more than one seriesLists the series below the plot.
RadarChart.gridbooleantrueThe rings of the value axis and the spokes.
RadarChart.formatValue(value: number) => stringlocale number (1,234.5); compact on the pills (1.2K)Formats values in the tooltip and on the pills of the value axis.
RadarChart.rollingNumbersbooleanfalseRolls the values in the tooltip to the next spoke’s. Off, they change at once.
RadarChart.formatX(value: ChartXValue) => stringtext as given; a date as Jan 5, and Jan 5, 2026 in the tooltipFormats the names of the spokes around the rim and in the tooltip heading.
RadarChart.localestringprovider, else en-USLocale of numbers and dates: the locale of SiteplaneLocaleProvider unless set, and en-US without one, so the server and the browser agree.
RadarChart.emptyLabelstringNo dataShown in place of the plot when there is nothing to draw.
RadarChart.labelsPartial<CartesianChartLabels>English wordsReplaces 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.
RadarChart.classNamestringunsetAdditional classes on the figure.
ChartSeries.keystringrequiredKey of the numbers of this series in each row.
ChartSeries.labelstringrequiredName shown in the legend and the tooltip.
ChartSeries.colorstringpalette colorA CSS color, such as var(--chart-3), that replaces the palette color of this series.
CartesianChartLabels.roleDescriptionstringchartWhat screen readers call the chart.
CartesianChartLabels.keyboardHintstringUse 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.
CartesianChartLabels.tostringtoJoins the first and the last spoke in the summary of the data, as in Mon to Sun.
CartesianChartLabels.loweststringlowestComes before the lowest value of each series in the summary.
CartesianChartLabels.higheststringhighestComes 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.

Read the installed source.

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.