React Charts

LineChart and BarChart, hand-rolled SVG on the --chart-1…5 tokens — a palette validated for color-vision deficiency in both themes. The rules are built in, not optional: 2px lines with ≥8px hover markers and a crosshair tooltip; thin bars with 2px surface gaps (stacked segments too); recessive hairline grid; a legend whenever there are two or more series; and every numeric readout in mono text tokens — never in series colors. Responsive via ResizeObserver.

Wafer yield by fab — weekly

8789919395W22W23W24W25W26W27W28W29
Fab 2Fab 3Foundry A

Regression runtime — single series with area

050100150200W22W23W24W25W26W27W28W29

Lots completed — grouped

012.52537.550W26W27W28W29
AXM-330RFX-91

Test time by insertion — stacked

0125250375500W26W27W28W29
Wafer sortFinal testSLT

Hover any chart — lines get a crosshair with markers, bars highlight per category, and every readout stays in text tokens.

Installation

npx shadcn@latest add charts.json

Usage

Loading...

Props

Shared by both charts: series: { name, data }[] (up to 5 — the validated palette), labels: string[], height?, unit?, title? (accessible name).

PropChartDefaultDescription
showAreaLinefalseSubtle area fill (single-series only)
stackedBarfalseStack series with 2px surface gaps

Series cap is deliberate: past five series, fold into "Other" or split into small multiples — never generate new hues.