Skip to content
synccn

Radar Chart

New

Spider chart for comparing a few things across several qualities, with hover values and toggleable series.

SpeedBundle sizeAccessibilityDocsTypeScriptTheming
Radar chart
AxisLibrary ALibrary B
Speed9 / 106 / 10
Bundle size8 / 105 / 10
Accessibility7 / 109 / 10
Docs6 / 109 / 10
TypeScript9 / 107 / 10
Theming8 / 106 / 10

Installation

$ pnpm dlx shadcn@latest add @synccn/radar-chart

First 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
    number

    Value at the outer ring. Defaults to the largest value.

  • rings
    number

    Default 4

    Rings drawn behind the shapes.

  • size
    number

    Default 300

    Width and height in pixels.

  • format
    (value: number) => string

    Default (v) => String(v)

    Formats values in the tooltip.

  • className
    string

    Extra 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

npm packages

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