Skip to content

Multi-series bar chart ​

Multi-series vertical bar chart for side-by-side comparison of a small group of series.

bar-multi places several series next to each other within each category, so readers can compare them at a glance. Reorder categories with sortMode; the top-level sort property is read only by bar-vertical, bar-horizontal, and donut. See Properties for every key it accepts.

When to use ​

  • Comparing 2–3 series across the same categories (e.g. medals by colour, revenue by product line)
  • When individual series values matter more than their totals
  • A small, fixed set of categories where the comparison is the story

When NOT to use ​

  • More than 3–4 series per group — the clusters become unreadable
  • When the total across series is the headline number — use bar-stacked or column-stacked
  • When the second dimension is itself a grouping (use bar-grouped)

Example ​

bpc
chart bar-multi {
  title = "USA tops Paris 2024 with 126 medals across all categories"
  description = "2024 Paris Summer Games — top six nations"
  source = "Olympics.com"
  sourceUrl = "https://olympics.com"
  colors = "#eeca3b, #c0c0c0, #cd7f32"
  legendPosition = "top"
  valueLabels = true
  sort = descending

  data {
    series = "Gold","Silver","Bronze"
    "USA" = 40,44,42
    "China" = 38,32,18
    "Japan" = 27,14,17
    "Great Britain" = 22,21,22
    "Australia" = 17,7,22
    "France" = 16,20,23
  }
}

Properties ​

Every property bar-multi 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
sortModeselect: none, total, within-groupstotal
legendbooleanfalse
legendAnchorselect: start, middle, endstart
legendPositionselect: top, bottom, left, righttop
directLabellingselect: "", auto, outside, insideauto
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 ​

  • Too many bars per group overwhelms the reader; cap at 3–4 series
  • Inconsistent colour encoding across charts in the same dashboard
  • Sorting by the wrong series — make sure the sort matches the comparison you want readers to make
  • bar-grouped — when the categories themselves cluster into a higher group
  • bar-stacked — when the total across series is the headline
  • column-stacked — composition over a small number of discrete columns

See also ​

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