4.2.0
Patterns

Charts

Small, fixed-shape marks for a glance, not an analysis.

MiniLineChart

One series, no legend — if it needs a legend it is not a mini chart.

Usage

import {
  Funnel,
  MiniBarChart,
  MiniLineChart,
  Sparkline,
} from '@oceanic-hub/brand-system'

Composition

Use the following composition to build with Charts:

MiniLineChart
Sparkline
MiniBarChart
Funnel

These are glanceable, not analytical — no legends, no tooltips, no interaction. If a reader needs to hover something to understand it, the chart is doing the wrong job and the surface wants Chart — this package's recharts chrome, where the tooltip, the legend and the axes live. Neither is a lightweight version of the other; they ship side by side, the export names do not collide, and this one is a fixed set — nothing new composes out of them.

A chart either has a name its caller gave it, or it is hidden — never a name this package invented. MiniLineChart and MiniBarChart assert role="img", so they will not let you ship one unnamed: a generic default like "Line chart" would tell a screen reader nothing it could not already get from the role, so there is no placeholder to fall back on. Sparkline is aria-hidden by default and stays decorative unless you pass label, because it usually sits beside the figure it trends — naming it too would announce that number twice.

color on Sparkline takes a semantic role, never a raw hex or a CSS variable: the colour arrives as data through a prop, which is exactly the one place the no-raw-hex lint rule cannot see a literal to catch. MiniBarChart's target draws the single reference rule a small chart can carry before it becomes noise.

Sparkline

A trend, not a chart: no axes, no gridlines, no tooltip. Read it at a glance.

MiniBarChart

label is required — the surface names what it plots, because the package cannot.

Target €40k€24kJan€31kFeb€28kMar€44kApr€39kMay€52kJun

Funnel

Stages in order, widths proportional to the first stage.

Visited
4,820
Started
1,240
26%
Completed
612
49%
Retained
288
47%

Sparkline roles

color takes a semantic role, never a colour — the roles a series can mean, shown in full.

brand
done
working
stuck
info
neutral

A divided bar, an unfinished one, and an annotation

value2 splits one bar into two segments — a whole divided in two, not a second series — so the value label reads the TOTAL and the geometry carries the split. A 2px gap in the ground separates them, because two abutting fills in two roles read as one bar changing colour at an arbitrary height. inProgress draws a period that is still accumulating as a dashed outline with no fill: the usual move, a lighter fill, reads as "smaller", which is the one thing it does not mean. note puts one short caption under the x-label for the outlier a bar cannot explain. The x-key is label now; month still works and is deprecated.

Target 2019W123W218W3quota pause26W49W5Target 2016W122W218W324W4

Two series in one mark

series2 overlays a second measurement of the same thing over the same x — drawn dashed, in a subordinate role, and sharing the primary's y-domain so one unit is one distance in both. At 96 pixels wide with no ticks there is no room for a second scale, and a twin-axis sparkline can draw a crossing that never happened. Texture, not hue, is what carries "this is the other one": it survives at this size and it does not depend on telling two colours apart. The mark stays anonymous — identity belongs to the legend you put beside it.

First passSecond pass
One series

API Reference

See the Charts API page for every prop of every part, with types, defaults and the contract that pins them.

On this page