shadcn.io is not affiliated with official shadcn/ui
Chart examples · Radar
A radar chart for React
A radar chart plotting one series across six months as a filled shape.
The starting point for comparing values across several axes at once. One series is plotted across six months as a filled shape on a polygon grid, and the tooltip shows the hovered month's value.
Preview
Installation
FAQ
How is the series drawn?
One Radar sets dataKey="desktop", fill="var(--color-desktop)", and fillOpacity={0.6}. ChartContainer defines --color-desktop from config, where label is Desktop and color is var(--chart-1).
How do months become the corners?
PolarAngleAxis reads dataKey="month". chartData has one row per month, January through June, and that row's desktop value is a vertex. Add a row to add a corner.
What does PolarGrid draw?
PolarGrid draws the concentric rings and the spokes. fillOpacity={0.6} on Radar leaves those rings visible through the fill. This demo doesn't pass grid props, so the grid stays a polygon.
What does the tooltip show?
ChartTooltip renders ChartTooltipContent and sets cursor={false}. The title is the hovered month, and the row is Desktop with that month's value. Keep the tooltip inside ChartContainer so it can read config.
Related
- A radar chart with multiple dataA radar chart overlaying desktop and
- A radar chart with dotsA radar chart with a dot on each data
- A radar chart with lines onlyA radar chart drawing two series as
- A simple area chartA single-series area chart with a smooth
- A bar chartA bar chart with rounded corners
- A radar chart with a grid and circleA radar chart with a circular grid and a