Static documentation

Data Visualisation Catalogue Gallery

Rendered markdown notes for the catalogue review, compiler mapping, implementation tracker, and chart method specs.

38 chart methods
10 with reference assets
43 documents

Stacked Bar Graph

Source: Data Visualisation Catalogue - Stacked Bar Graph

Stacked bar graph reference

Stacked bar graph anatomy

Why This Belongs In The Compiler Gallery

The catalogue defines stacked bar graphs as segmented bars used to show how a larger category divides into smaller subcategories. The compiler already has a stack transform and rect segment rendering, so this is a direct fit.

Data Contract

Each raw data row represents one subcategory value inside a parent category.

FieldTypePurpose
categorycategoricalParent bar.
seriescategoricalSegment within the bar.
valuequantitativeSegment magnitude.
startquantitative, derivedStack start position.
endquantitative, derivedStack end position.
percentStartquantitative, derivedStart for 100 percent stack mode.
percentEndquantitative, derivedEnd for 100 percent stack mode.

Expected Visual

The faithful catalogue version should show each category as one bar split into adjacent colored segments. The simple stacked version uses absolute values and different total bar lengths. The 100 percent version normalizes every bar to the same full length and compares relative composition.

ElementExpected treatment
SegmentsRects using start and end bounds on a shared scale.
ColorOrdinal palette keyed by series.
BaselineAll parent bars share a common zero baseline.
LabelsParent category labels; optional segment or total labels.
LegendNeeded for segment colors.

Compiler Mapping

Compiler partMapping
Data sourceraw-stacks and derived segments.
Transformstack to compute start/end; optional normalize mode for 100 percent stacks.
Scalesx: linear, y: band, color: ordinal for horizontal; swap x/y for vertical.
Layersrect segment glyphs, text parent labels, optional total/segment labels, line guides.
InteractionSegment hover should expose category, series, value, and segment bounds.

Faithfulness Notes

The catalogue warns that segment comparison is hard because most segments do not share a baseline. The gallery should surface that by keeping simple stacks for part-to-whole and using grouped bars when the task is direct subcategory comparison.