Controls

Dot Matrix 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.

Dot Matrix Chart
  • Reads
  • Writes

Requests by hour
hourReadsWrites
0883
09186
10269
112212
12308
132410
143414
153811
162912
17218
18145
1994

Dot Matrix Chart

Columns of small dots that light up from the bottom, stacked by series.

Installation

npx shadcn@latest add ikislay/pixel-ui/dot-matrix-chart

How to use

import { 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 (
<DotMatrixChart
label="Requests by hour"
data={data}
index="hour"
series={[

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 keys to plot. Colors follow the chart palette in order unless you set one.

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.

rows
number

Dots per column. Each dot stands for the same amount, so fewer rows means coarser steps.

className
string

Merged onto the root element.