Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Chart examples · Radar

A radar chart with dots for React

A radar chart with a dot on each data point.

Framework
UI library

A filled radar shape with a dot on each month, so the measured points stand out from the area between them.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

How do I show a dot on each radar point?

Set dot on Radar. This demo uses r of 4 and fillOpacity of 1, so each vertex is a solid dot. Radar leaves dot off unless you pass it.

How is the polygon colored?

fill is var(--color-desktop). ChartContainer writes that from the desktop entry in config, where label is Desktop and color is var(--chart-1). fillOpacity={0.6} keeps the PolarGrid rings visible through the shape.

Where do the month labels come from?

PolarAngleAxis uses dataKey="month". Each row of chartData is one spoke, January through June, and desktop on that row is the dot's value. Add a row and the polygon gains a corner.

What does the grid draw?

PolarGrid draws the concentric rings and the spokes. This demo doesn't pass grid props, so you get that default polygon grid. The rings are the scale behind each dot.

What does the tooltip show?

ChartTooltip renders ChartTooltipContent and sets cursor={false}, which turns the hover cursor off. The title is the month under the pointer, and the row name is Desktop from config.

How do I keep the radar square?

ChartContainer sets mx-auto aspect-square max-h-[250px] inside a w-full max-w-xl frame. The container defaults to a 16:9 box, so the square classes are what hold this plot even.