Skip to content

Stacked column chart ​

Stacked vertical column chart for composition over discrete columns; supports percent stacking.

column-stacked is the vertical sibling of bar-stacked — each column breaks down into segments. It's the right choice when the x-axis represents a small number of ordered steps (quarters, fiscal years, study cohorts). Set stackMode = "percent" for a 100 % composition view. See Properties for every key it accepts.

When to use ​

  • Composition over a small number of discrete columns (5–10 quarters, years, or stages)
  • When both the total and the breakdown matter for each column
  • 100 % stacked view (stackMode = "percent") when readers should focus on relative share

When NOT to use ​

  • More than ~10 time points — switch to area-stacked
  • Data with negative values — stacking breaks down
  • When precise segment-to-segment comparison is needed across columns

Example ​

bpc
chart column-stacked {
  theme = "blueprint-bold"
  colorPalette = "BlueprintBold"
  title = "Software revenue grew steadily while hardware spiked in Q4"
  description = "Quarterly revenue in millions, 2024"
  source = "Annual report"

  data {
    series = "Hardware","Software","Services"
    "Q1" = 120,85,45
    "Q2" = 135,92,48
    "Q3" = 128,98,52
    "Q4" = 155,105,58
  }
}

Properties ​

Every property column-stacked accepts, beside the frame and layout keys every chart shares. Anything absent from this table is rejected by validateChart and ignored by the renderer.

PropertyTypeDefault
colorscolors(unset)
colorPaletteselect, see PalettesBlueprint
autoContrastbooleanfalse
allowDarkModebooleantrue
stackModeselect: normal, percentnormal
sortModeselect: none, total, within-groupsnone
legendbooleantrue
legendAnchorselect: start, middle, endstart
legendPositionselect: top, bottom, left, righttop
directLabellingselect: "", auto, outside, inside""
directLabelAnchorselect: start, middle, endmiddle
showVerticalAxisbooleanfalse
verticalAxisDirectionselect: left, rightleft
showVerticalTicksbooleanfalse
verticalLabelPositionselect: auto, inside, outside, offoff
verticalGridStyleselect: solid, dashed, dotted, nonenone
verticalNumberFormatnumberFormat(unset)
verticalScaleTypeselect: linear, loglinear
verticalRangeMintext(unset)
verticalRangeMaxtext(unset)
showHorizontalAxisbooleantrue
showHorizontalTicksbooleanfalse
horizontalLabelPositionselect: auto, inside, outside, offauto
horizontalLabelRotationselect: auto, horizontal, verticalhorizontal
horizontalGridStyleselect: solid, dashed, dotted, nonenone
horizontalNumberFormatnumberFormat(unset)
valueLabelsbooleantrue
valueLabelPositionselect: auto, outside, insideauto
tooltipsbooleanfalse
crosshairbooleanfalse
crosshairDirectionselect: both, vertical, horizontalboth
crosshairStyleselect: solid, dashed, dotteddashed
crosshairColortext#999

Common pitfalls ​

  • Stacking too many series — the top layers float and lose their baseline
  • Switching to stackMode = "percent" without telling the reader hides the change in absolute total
  • Inconsistent segment ordering between columns destroys the visual flow
  • bar-stacked — horizontal equivalent for long category labels
  • area-stacked — same idea with many time points
  • bar-multi — when you want side-by-side comparison instead of stacking

See also ​

Released under the MIT License. Built static-first — your data never leaves the page.