shadcn.io is not affiliated with official shadcn/ui
Chart examples · Radial
A radial chart with a label for React
A radial bar chart labeling each ring with its browser's name.
Use it when each ring should carry its own name. A LabelList writes the browser's label at the start of each ring, and the rings span more than a full turn, from startAngle -90 to endAngle 380.
Preview
Installation
FAQ
How do the browser names get onto the rings?
LabelList sits inside RadialBar with dataKey="browser" and position="insideStart". insideStart places each name at the start of that arc, inside the band. fontSize is 11.
Why do the labels read Chrome when the data says chrome?
The rows store lowercase keys (chrome, safari, and the rest). LabelList sets capitalize in its className, which capitalizes that text. The same keys in config already have labels Chrome, Safari, Firefox, Edge, and Other for the tooltip.
How do the labels stay readable on every color?
The className is fill-background capitalize mix-blend-luminosity. fill-background is the base paint, and mix-blend-luminosity blends that with the ring underneath.
Why do the rings run past a full circle?
RadialBarChart sets startAngle={-90} and endAngle={380}. That sweep is longer than 360 degrees, so a full value runs past one turn. innerRadius={30} and outerRadius={110} set the band the labels sit in.
Related
- A radial chartA radial bar chart with one ring per
- A radial chart with textA radial bar chart with one rounded ring
- A pie chart with a label listA pie chart with each browser's name
- A radial chart with a gridA radial bar chart with circular grid
- A line chart with a labelA line chart with a dot on each point and
- A bar chart with a labelA bar chart with each bar's value printed