shadcn.io is not affiliated with official shadcn/ui
Chart examples · Radial
A radial chart with a grid for React
A radial bar chart with circular grid lines behind its rings.
Concentric rings, one per browser, over circular grid lines that help estimate how far each arc goes. The tooltip names the browser and its count.
Preview
Installation
FAQ
How do I add circular grid lines?
PolarGrid sets gridType="circle", so the grid is circles. It sits behind one RadialBar with dataKey="visitors". This file doesn't set background on that bar, so there is no full-circle track behind each arc.
Why are there spokes as well as circles?
PolarGrid leaves radialLines at its default, which is on, so the spokes still render. Set radialLines={false} on that same PolarGrid when you want only the circles.
How thick are the rings?
RadialBarChart sets innerRadius={30} and outerRadius={100}. The five browser rows share that band, and each row's visitors value sets how far its arc runs.
How does the tooltip name each browser?
ChartTooltipContent sets hideLabel and nameKey="browser". hideLabel hides the title. nameKey looks up the row's browser field in config, so the row reads Chrome, Safari, Firefox, Edge, or Other. cursor={false} turns the hover cursor off.
Related
- A radial chartA radial bar chart with one ring per
- A radial chart with textA radial bar chart with one rounded ring
- A radar chart with a grid and circleA radar chart with a circular grid and a
- A radial chart with a labelA radial bar chart labeling each ring
- A bar chartA bar chart with rounded corners
- A radial chart with stacked sectionsA half-circle radial chart stacking