Controls

Comb 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.

Comb Chart

Commits per day
dayCommits
Day 16
Day 210
Day 39
Day 48
Day 510
Day 610
Day 75
Day 84
Day 96
Day 105
Day 114
Day 127
Day 1311
Day 1410
Day 1510
Day 1612
Day 1712
Day 188
Day 196
Day 208
Day 218
Day 225
Day 238
Day 2412
Day 2512
Day 2611
Day 2714
Day 2815
Day 2911
Day 309
Day 3111
Day 3210
Day 337
Day 349
Day 3514
Day 3614

Comb Chart

A dense row of thin rounded teeth for long runs of values.

Installation

npx shadcn@latest add ikislay/pixel-ui/comb-chart

How to use

import { CombChart } from "@/components/ui/comb-chart"
const data = Array.from({ length: 30 }, (_, i) => ({
day: String(i + 1),
commits: Math.round(4 + Math.random() * 10),
}))
export function Demo() {
return (
<CombChart
label="Commits per day"
data={data}
index="day"
series={[{ key: "commits", label: "Commits" }]}
/>

Source Code

// Loading…

Props

Options you can pass to customize this component.

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

One object per point along the x axis.

index*
string

The key in each object that labels the x axis.

series*
{ key: string; label?: string; color?: string }[]

The key to plot. Only the first series is drawn.

label*
string

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

height
number

Height in pixels. The width fills the parent.

format
(value: number) => string

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

className
string

Merged onto the root element.