Five forms — bar, line, donut, sparkline, stat — in the ENOK earthy palette.
Zero dependencies, no build step, no network. Three laws hold everywhere: the baseline is zero
and the axis says so, missing is not zero, and colour is never the only channel.
Every chart below ships a real data table; press Tab to a plot and use the arrow keys
to read it without a mouse.
1 · Stat tiles — a number is a chart
A one-bar bar chart is a stat tile that has not admitted it yet. The middle tile has
no previous value, so it shows no delta at all — not “0%”. The right tile knows that for
churn, down is the good direction; without that instruction no delta is ever painted green.
2 · Bar — grouped, with a real gap
March has no figure for Agents. The bar is absent and the table says
“no data” — a missing month is not a month of zero. Zero stays on the axis whether or not the
data goes near it: cropping a bar exaggerates every difference it draws.
3 · Bar — stacked
Segments are separated by a 2px surface gap, never by a border drawn around the mark.
4 · Line — three series, one gap, one axis
Each series carries a hue and a dash pattern and a marker shape, and is
labelled at its own last point. The line breaks where a week is missing rather than drawing a
straight guess through it. There is no second y-axis available: two scales on one plot invent a
correlation the data never had.
5 · Line — an axis that does not start at zero
A line may crop its axis — small movements in a large number are the reason line
charts exist — but then it prints “y-axis starts at N, not zero” under the plot, where the
reader can see it. Ask a bar for the same favour and it refuses in writing.
6 · Donut — the part that is not accounted for
The parts sum to 780 of a stated 1,000. The kit draws the missing 220 as a labelled
Unaccounted segment instead of quietly rescaling the slices to fill the ring. Past six
segments it folds the tail into “Other” rather than minting a seventh hue.
7 · Sparklines — inline, and honest when empty
A sparkline prints its latest value and carries a spoken sentence for screen
readers. Handed nothing, it says “No data” rather than drawing a flat line along zero.
8 · What the kit refuses to draw
The bar was asked for a truncated baseline and a second y-axis; the line was asked
to fill the area under two overlapping series. All three requests were refused, and every refusal
is printed under its own chart rather than swallowed. A library that silently honours a
misleading request is a library that helps you mislead.
9 · Declarative mount — no JavaScript of your own
Drop the markup in, call EnokCharts.mount() once, and every
[data-chk-chart] block on the page renders. The spec is parsed with
JSON.parse — never eval — so this works under a strict CSP. A spec that
does not parse says so and guesses nothing.
The palette — validated, not eyeballed
Six categorical slots, assigned in fixed order and never cycled. Snapped to the
nearest passing step of the ENOK hue families and checked per mode for lightness band, chroma
floor, adjacent separation under protanopia and deuteranopia, a normal-vision floor, and 3:1
contrast against the surface. Light clears ΔE 11.8 (CVD) and 20.4 (normal); dark clears 11.4 and
22.8. Change a value and re-run the check before you ship it.