Simulates prefers-reduced-motion for the demo. Off follows your system setting.
Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.
1
| hour | Reads | Writes |
|---|---|---|
| 08 | 8 | 3 |
| 09 | 18 | 6 |
| 10 | 26 | 9 |
| 11 | 22 | 12 |
| 12 | 30 | 8 |
| 13 | 24 | 10 |
| 14 | 34 | 14 |
| 15 | 38 | 11 |
| 16 | 29 | 12 |
| 17 | 21 | 8 |
| 18 | 14 | 5 |
| 19 | 9 | 4 |
Columns of small dots that light up from the bottom, stacked by series.
npx shadcn@latest add ikislay/pixel-ui/dot-matrix-chartimport { DotMatrixChart } from "@/components/ui/dot-matrix-chart"const data = [{ hour: "09", reads: 18, writes: 6 },{ hour: "10", reads: 26, writes: 9 },{ hour: "11", reads: 22, writes: 12 },]export function Demo() {return (<DotMatrixChartlabel="Requests by hour"data={data}index="hour"series={[
1// Loading…
Options you can pass to customize this component.
data*Record<string, string | number>[]One object per point along the x axis.
index*stringThe key in each object that labels the x axis.
series*{ key: string; label?: string; color?: string }[]The keys to plot. Colors follow the chart palette in order unless you set one.
label*stringNames the chart for screen readers and captions its data table.
heightnumberHeight in pixels. The width fills the parent.
format(value: number) => stringFormats values wherever the chart shows them. Defaults to short numbers like 12.4K.
rowsnumberDots per column. Each dot stands for the same amount, so fewer rows means coarser steps.
classNamestringMerged onto the root element.