Radar chart
Compare a few profiles across several measures that share a meaningful scale.
- Current
- Previous
- Current
- 82 points
- Previous
- 68 points
View data table 5 rows
| Data point | Current | Previous |
|---|---|---|
| Clarity | 82 points | 68 points |
| Speed | 71 points | 74 points |
| Focus | 88 points | 76 points |
| Coverage | 77 points | 64 points |
| Polish | 84 points | 72 points |
Installation
bunx --bun shadcn@latest add https://apple-ui-eduardo.vercel.app/r/radar-chart.jsonThe registry includes the shared styles and dependencies. Import @/components/apple-ui/styles.css in your root layout once. For the package route, use the installation guide.
Usage
"use client";
import { RadarChart } from "@eduardoul/apple-ui";
const data = [
{ label: "Clarity", current: 82, previous: 68 },
{ label: "Speed", current: 71, previous: 74 },
{ label: "Focus", current: 88, previous: 76 },
{ label: "Coverage", current: 77, previous: 64 },
{ label: "Polish", current: 84, previous: 72 },
];
export function Example() {
return (
<RadarChart
title="Project review"
description="Synthetic scores in points"
data={data}
series={[
{ key: "current", label: "Current" },
{ key: "previous", label: "Previous" },
]}
valueFormatter={(value) => value + " points"}
/>
);
}Package imports use @eduardoul/apple-ui. Registry imports use @/components/apple-ui. Add "use client" to files that use state or event handlers.
API reference
| Property | Type | Default |
|---|---|---|
| data | ChartDatum[] | required |
| series | ChartSeries[] | required |
| labelKey | string | label |
| title | string | required |
| description | string | undefined |
| height | number | component default |
| loading | boolean | false |
| error | string | undefined |
| emptyMessage | string | No data to display. |
| showTable | boolean | true |
| compact | boolean | false |
| valueFormatter | (value: number) => string | localized number |
| className | string | undefined |
| style | React.CSSProperties | undefined |
Use className and style to customize the component. The package includes full TypeScript definitions for its supported element properties and refs.
Design guidance
- Use radar charts for profile shape when every measure uses the same scale and direction.
- Limit the number of profiles. Overlapping polygons become hard to trace quickly.
- Provide at least three categories and a finite nonnegative value for every series in every category.
- Pair the visual with the built in data table when readers need exact comparisons.
Accessibility
Give the chart a descriptive title and explain its units. Select a data point to read its values, or open the data table for the full dataset. Labels and values accompany color, and the chart adapts to reduced motion and appearance preferences. Test long labels, touch input and keyboard navigation with your own data.
Library styles support reduced motion, reduced transparency, increased contrast and forced colors. Read the accessibility foundation for the checks your application still needs.