shadcn.io is not affiliated with official shadcn/ui
About
Pick this one over the plain radar when people read individual values, not only the outline: a dot marks where each month actually lands, so small differences between neighbors are easier to see. It also helps when the grid is light or missing.
The shape is the same six-month polygon at 60% fill, with a solid dot of radius 4 on each corner in the series color, over polygon rings and spokes.
Installation
Usage
import { ChartRadarDots } from "@/components/charts/chart-radar-dots";<ChartRadarDots />Customize
- One
<Radar dataKey="desktop">draws both the shape and the dots:dot={{ r: 4, fillOpacity: 1 }}turns the markers on. activeDotstyles the dot of the active month; without it Recharts uses the default.<PolarGrid />with no props draws the polygon rings and the spokes behind it.- The tooltip is
ChartTooltipContentwith its default dot indicator and the month as its label.
FAQ
How are the dots drawn?
Through the dot prop on <Radar>: dot={{ r: 4, fillOpacity: 1 }}. r is the radius in pixels and fillOpacity: 1 makes the dots solid while the shape stays at 0.6.
How do I make the dots bigger or smaller?
Change r in the dot object on <Radar>. 4 suits six spokes; go down to 2 or 3 for many categories, up to 6 for a few.
Can the dots be a different color from the shape?
Yes. Pass fill and stroke in the dot object, dot={{ r: 4, fill: "var(--chart-2)", stroke: "var(--background)" }} for example. The shape keeps its own fill.
API Reference
ChartContainer
configChartConfig
Each series by its data key: its label, an icon, and a color (or a * theme color per light and dark), read by the tooltip and legend and set * as --color-<key>.
initialDimension?{ height: number; width: number; }
The size it renders at before it's measured, so the first paint isn't * empty.
- Type
{ height: number; width: number; }- Default
INITIAL_DIMENSION
className?string
Merged with the part's classes.
ChartLegend
ChartLegendContent
<div>
hideIcon?boolean
Hides each series' icon (from config), leaving its color swatch.
- Default
false
nameKey?string
The key in each legend item's data to look its label up by in config. * Defaults to the item's dataKey.
className?string
Merged with the part's classes.
ChartStyle
<style>
configChartConfig
The chart config whose colors it writes as --color-<key> variables.
idstring
The element's id.
ChartTooltip
ChartTooltipContent
<div>
hideIndicator?boolean
Hides each item's color indicator.
- Default
false
hideLabel?boolean
Hides the tooltip's label, the hovered point's.
- Default
false
indicator?"dashed" | "dot" | "line"
The color indicator's shape: a dot, a line or dashed.
- Type
"dashed" | "dot" | "line"- Default
"dot"
labelFormatter?(label: any, payload: TooltipPayload) → React.ReactNode
Formats the tooltip's label; its value is untyped, as in recharts 3.8.
- Type
(label: any, payload: TooltipPayload) → React.ReactNode- Parameters
label– anypayload– TooltipPayload- Returns
React.ReactNode
labelKey?string
The key in the data to read the label from, looked up in config.
nameKey?string
The key in each item's data to look its name up by in config.
className?string
Merged with the part's classes.
Related
Radar Chart
Radar chartsOne series on a polygon grid, six months around the center.
Radar Chart with Circle Grid
Radar chartsA radar on circular grid rings instead of polygons.
Radar Chart without Grid
Radar chartsA radar shape with no grid behind it.
Line Chart with Dots
Line chartsA line with a dot on every data point.
Radar Chart with Lines Only
Radar chartsTwo radar series as outlines only, no fill.
Multiple Radar Chart
Radar chartsTwo series overlaid on the same radar grid.