Controls

Radial Bar Chart

Preview
Reduced motion

Simulates prefers-reduced-motion for the demo. Off follows your system setting.

Keyboard stepping

Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.

Radial Bar Chart

Orders by hour
hourorders
0:0011
1:0013
2:008
3:004
4:004
5:008
6:0016
7:0017
8:0015
9:0021
10:0034
11:0043
12:0042
13:0040
14:0044
15:0052
16:0053
17:0044
18:0035
19:0034
20:0036
21:0031
22:0018
23:009

Radial Bar Chart

Rounded bars that radiate around a ring, made for cycles like hours or months.

Installation

npx shadcn@latest add ikislay/pixel-ui/radial-bar-chart

How to use

import { RadialBarChart } from "@/components/ui/radial-bar-chart"
const data = Array.from({ length: 24 }, (_, hour) => ({
hour: hour + ":00",
orders: Math.round(20 + 15 * Math.sin((hour - 6) / 3.8)),
}))
export function Demo() {
return <RadialBarChart label="Orders by hour" data={data} index="hour" value="orders" totalLabel="Orders" />
}

Source Code

// Loading…

Props

Options you can pass to customize this component.

Prop
Type
Description
data*
Record<string, string | number>[]

One object per bar, clockwise from the top.

index*
string

The key in each object that names the bar.

value*
string

The key in each object that holds the bar's value.

label*
string

Names the chart for screen readers and captions its data table.

format
(value: number) => string

Formats values wherever the chart shows them. Defaults to short numbers like 12.4K.

color
string

Any CSS color for the bars.

totalLabel
string

The caption above the total in the center.

className
string

Merged onto the root element.