Radar Chart
NewSpider chart for comparing a few things across several qualities, with hover values and toggleable series.
| Axis | Library A | Library B |
|---|---|---|
| Speed | 9 / 10 | 6 / 10 |
| Bundle size | 8 / 10 | 5 / 10 |
| Accessibility | 7 / 10 | 9 / 10 |
| Docs | 6 / 10 | 9 / 10 |
| TypeScript | 9 / 10 | 7 / 10 |
| Theming | 8 / 10 | 6 / 10 |
Installation
$ pnpm dlx shadcn@latest add @synccn/radar-chartFirst time in this project? Connect synccn with one command.
Usage
import { RadarChart } from "@/components/ui/radar-chart";<RadarChart axes={axes} series={[{ name: "A", values }]} max={10} />API reference
Generated from the component's TypeScript types, so it always matches the code.
RadarChart
Spider chart for comparing a few things across several qualities (plans, candidates, releases). Hover an axis for exact values; a hidden table carries the data for screen readers.
- axesrequired
string[]Axis labels, going clockwise from the top.
- seriesrequired
RadarSeries[]—
- max
numberValue at the outer ring. Defaults to the largest value.
- rings
numberDefault
4Rings drawn behind the shapes.
- size
numberDefault
300Width and height in pixels.
- format
(value: number) => stringDefault
(v) => String(v)Formats values in the tooltip.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
Accessibility
- A visually hidden table holds every value. Legend items are toggle buttons.
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA roles: img
- ARIA attributes: aria-labelledby, aria-pressed
- Includes text only screen readers hear