@risqbase-inc/ui-components · v2.2.0

Charts

28 active types. Ten purpose groups. One menu.

Every chart in any RisqBase product must be classifiable as exactly one of the canonical types. If a proposed chart can't be classified, reconsider the chart before inventing a new type. ChartContainer currently implements 7 of these as React primitives (line · bar · sparkline · area · heatmap · metric-card · choropleth); the rest are taxonomy entries with library guidance pending v4.4. Sources: Datawrapper Academy, Apple Swift Charts, Observable Plot, Cleveland-McGill perceptual ranking.

The 28-type taxonomy

Filter by purpose group to find a chart that fits the question you're asking the data.

Comparison

Bar (vertical)

2–12 categories, short labels.

Comparison

Bar (horizontal)

8–40 categories or long labels.

Comparison

Grouped bar

2–4 sub-series across 2–8 categories.

Comparison

Lollipop

Values cluster at similar magnitudes.

Comparison

Dot plot

Comparing categories where zero matters.

Distribution

Histogram

Frequency distribution of a continuous variable.

Distribution

Box plot

Five-number summary across 2–12 groups.

Distribution

Violin

Distribution shape, not just summary.

Distribution

Density curve

2–3 overlapping distributions.

Composition

Stacked bar

2–6 components; exact totals matter.

Composition

Stacked area

Time-series cumulative decomposition.

Composition

Treemap

10–50 leaves; ranking over exact values.

Composition

Sunburst

Part-to-whole emphasising the hierarchy.

${Array.from({length: 50}).map((_,i)=>``).join('')}
Composition

Waffle

Single value as ~100 unit-squares.

Relationship

Scatter

Two continuous vars, 10–10,000 observations.

Relationship

Paired bar

Before / after · plan / actual.

Time

Line

1–8 series on a continuous time axis.

Time

Area

Single series cumulative magnitude.

Time

Sparkline

Inline trend · 64×24 default.

Geographic

Choropleth

Map-bound categorical / sequential.

Geographic

Symbol map

Map-bound magnitude bubbles.

Part-to-whole

Donut

2–5 parts; prohibitions enforced.

${Array.from({length:50}).map((_,i)=>``).join('')}
Part-to-whole

Waffle (large)

Part-to-whole at scale.

Part-to-whole

Stacked-bar-100%

Single bar broken into shares.

87.2%
Coverage
Single-value

Metric / KPI card

Counts · currency · duration.

Single-value

Gauge

0–100 score · primitive in data-viz/.

Single-value

Sparkbar

Inline bar trend.

Flow

Funnel

Conversion drop-off across stages.

${[0.1,0.3,0.5,0.7,0.9,0.6,0.2,0.4,0.5,0.7,0.9,0.5,0.8,0.3,0.1,0.2,0.4,0.6,0.8,0.5,0.1,0.3,0.5,0.7,0.4,0.6,0.8,0.2,0.4,0.6].map((v,i)=>``).join('')}
Heatmap

Heatmap

Two-dimensional categorical / sequential.

Time · DEFERRED v5

Candlestick

OHLC encoding.

Relationship · DEFERRED

Bubble

Prohibited per §8.1.3 (area mis-perceived).

Geographic · DEFERRED v5

Flow map

Origin-destination arcs.

Flow · DEFERRED v5

Sankey

Multi-stage flow.

Decision matrix

Eleven rows mapping data-shape → canonical chart type. If the data fits more than one row, prefer the type with higher Cleveland-McGill perceptual rank.

If your data is…
DM #
Canonical type
Fallback
2–12 discrete categories, short labels
DM-1
Bar (vertical)
Lollipop · Dot plot
8–40 categories OR long labels
DM-2
Bar (horizontal)
Lollipop
2–4 sub-series across 2–8 categories
DM-3
Grouped bar
Paired bar (n=2)
Frequency distribution of one continuous var
DM-4
Histogram
Box plot · Violin
Mutually-exclusive components, totals matter
DM-5
Stacked bar
Waffle · Stacked-bar-100%
Hierarchical part-to-whole, 10–50 leaves
DM-6
Treemap
Sunburst
Time-series, 1–8 series
DM-7
Line
Area · Small multiples
Two continuous vars, looking for correlation
DM-8
Scatter
Small-multiples scatter
Map-bound data with regional granularity
DM-9
Choropleth
Symbol map
Single value, 0–100, "how much of x is good"
DM-10
Gauge
Metric card
Single value, count / currency / duration
DM-11
Metric / KPI card
Sparkline appended

Palettes

Categorical · 8 colours

Ordered for perceptual difference. Cycle past 8 → use small-multiples.

Sequential · 10 stops

Single-hue per domain: risk · financial · operational.

${[160,158,156,155,155,155,156,158,160,162].map((h,i)=>`
`).join('')}

Above: financial ramp · L\\* 97 → 18.

Diverging · 9 stops

Warm + cool variants. n4 / p4 ≥7:1 vs surface.

Above: cool diverging · 9-stop.

Full chart-domain ramps in the token explorer →

Themes

Charts inherit the active theme via CSS variables. In dark, plot-area + legend + tooltip darken; mark colours stay in family but L\\* lifts for readability. In HC, marks differentiate via shape, dash, and pattern - colour cannot carry meaning. In print, fills collapse to greyscale with pattern overlays.

Library pin

visx@^3.0.0 is the charting library (per spec §8.7). Visx is composable Visx-component wrappers around D3 utilities. peerDependencies declared; CI-locked via package-lock.json; the 4.x upgrade is a major version bump.

Rejected: Recharts (limited composition), Observable Plot (Node-only data-grammar), Nivo (heavier runtime), Direct D3 (no React idiom).

Accessibility