shadcn.io is not affiliated with official shadcn/ui
Chart examples · Radar
A radar chart with lines only for React
A radar chart drawing two series as outlines without a fill.
Use outlines when two filled shapes would cover each other. Both series are drawn with fillOpacity={0} and a stroke, on a grid without spokes.
Preview
Installation
FAQ
How do I draw the radar as an outline?
Each Radar sets fillOpacity={0}, stroke to its series color, and strokeWidth={2}. Desktop uses var(--color-desktop) and mobile uses var(--color-mobile). The fill is still set, and fillOpacity={0} makes it transparent so only the stroke shows.
How do I hide the spokes?
PolarGrid sets radialLines={false}. The concentric grid stays, and the lines from the center out to each month are omitted. PolarAngleAxis still prints month with dataKey="month".
How are the two outlines told apart?
Two Radar components share one RadarChart and the same chartData. dataKey is desktop on one and mobile on the other. config names them Desktop and Mobile and maps their colors to var(--chart-1) and var(--chart-2).
What does the tooltip list?
ChartTooltipContent sets indicator="line", a short bar in the series color beside each name. Hovering a month lists both Desktop and Mobile. cursor={false} on ChartTooltip turns the hover cursor off.
Related
- A radar chartA radar chart plotting one series across
- A radar chart with no gridA radar chart without a grid, showing
- A line chartA line chart drawing one series as a
- 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 simple area chartA single-series area chart with a smooth