shadcn.io is not affiliated with official shadcn/ui
About
Most radars hide their scale. This one prints it: the ring values run up one spoke, so people can tell that a corner sits near 240 without hovering. Use it for analytical views or when several radars need to share a visible scale.
Desktop and Mobile overlap on four polygon rings at 80, 160, 240 and 320, the numbers set along a tilted spoke in the foreground color. There are no month names at the edge; the tooltip gives the values per month.
Installation
Usage
import { ChartRadarRadius } from "@/components/charts/chart-radar-radius";<ChartRadarRadius />Customize
<PolarRadiusAxis angle={60} orientation="middle" axisLine={false} stroke="var(--foreground)" />prints the scale along one spoke.- There's no
<PolarAngleAxis>, so the months aren't written around the edge. <PolarGrid />draws polygon rings at the radius axis' ticks.<ChartTooltipContent indicator="line" labelKey="month" />lists both series for the hovered month.
FAQ
How are the radius values drawn?
<PolarRadiusAxis angle={60} orientation="middle" axisLine={false} />. Recharts measures angle counterclockwise from three o'clock, so 60 lands between January and February.
How do I move the values to another spoke?
Change angle on <PolarRadiusAxis>, in degrees counterclockwise from three o'clock: 90 is straight up.
How do I change the numbers on the axis?
Set tickCount or domain on <PolarRadiusAxis>, and tickFormatter to change how each number prints.
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 with Custom Labels
Radar chartsAxis labels that show each month's values above its name.
Multiple Radar Chart
Radar chartsTwo series overlaid on the same radar grid.
Radar Chart with Custom Grid
Radar chartsA radar with a custom grid: one outer ring, no spokes.
Area Chart with Axes
Area chartsStacked areas with both axes and their tick labels drawn.
Radial Chart with Grid
Radial chartsRadial bars over circular grid lines.
Radar Chart
Radar chartsOne series on a polygon grid, six months around the center.