Radar Chart
Installation
Install the component via the CLI in one command.
npx shadcn@latest add @intentui/radar-chart
Composed components
When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.
Manual installation
Install the chart dependencies, then copy the component source into your project.
npm install recharts react-aria-components
Usage
Pass the dimension field to dataKey, then describe every numeric field in series. The matching keys in config provide labels and optional colors for the tooltip and legend.
<RadarChart
data={data}
dataKey="metric"
series={[
{ dataKey: "current", name: "Current quarter" },
{ dataKey: "previous", name: "Previous quarter" },
]}
config={{
current: { label: "Current quarter" },
previous: { label: "Previous quarter" },
}}
/>Examples
Multiple series
Add multiple series to compare profiles. A selectable legend is shown automatically when more than one series is present.
Custom colors
Set a color on each series in the chart configuration to match your product or data semantics.
Circular grid
Forward options to the Recharts polar primitives to customize the grid and radial scale.
Component API
RadarChart
RadarChart extends the native <div> element and composes the Intent UI <Chart> component.
angleAxisPropsOmit<ComponentProps<typeof PolarAngleAxis>, "dataKey">chartPropsOmit<ComponentProps<typeof RadarChartPrimitive>, "data">childrenReactNodeclassNamestringcolorsreadonly string[]DEFAULT_COLORSconfigChartConfigcontainerHeightnumber360dataRecord<string, any>[]dataKeystringlegendbooleanseries.length > 1polarGridPropsComponentProps<typeof PolarGrid>radiusAxisPropsComponentProps<typeof PolarRadiusAxis>seriesRadarChartSeries[]tooltipboolean | ComponentProps<typeof ChartTooltip>["content"]truetooltipPropsOmit<ComponentProps<typeof ChartTooltip>, "content">See the Recharts RadarChart API reference for primitive-specific options.
RadarChartSeries
dataKeystringnamestringradarPropsOmit<ComponentProps<typeof Radar>, "dataKey" | "name">