Skip to content

Vertical bar chart ​

Single-series vertical bar chart for ranked categorical comparison, small N.

bar-vertical compares discrete categories using the height of rectangular bars. It honours sort, sortMode, valueLabels, and valueLabelPosition. The alias vertical-bar is registered against the same renderer so .bpc documents can read either way.

When to use ​

  • Comparing quantities across a small number of categories (< 12)
  • Ranking items when the category labels are short enough to fit horizontally
  • A few data points over time (e.g. annual totals for 5 years)

When NOT to use ​

  • Continuous data distributions (no built-in histogram type)
  • Many time periods — use line for trends
  • Long category labels that would need rotation — use bar-horizontal

Example ​

bpc
chart bar-vertical {
  title = "Brazil produces more coffee than the next three countries combined"
  description = "Million 60-kg bags, 2023/24 crop year"
  source = "USDA Foreign Agricultural Service"
  sourceUrl = "https://www.fas.usda.gov/data/coffee-world-markets-and-trade"
  colorPalette = "Harvey"
  valueLabels = true
  valueLabelPosition = "auto"

  data {
    "Brazil" = 66.4
    "Vietnam" = 27.5
    "Colombia" = 12.76
    "Ethiopia" = 9.13
    "Indonesia" = 7.65
    "Honduras" = 5.5
  }

  colorize "Brazil" {
    color = "#a4432d"
  }

  transform sort {
    column = "value"
    direction = descending
  }
}

Properties ​

Every property bar-vertical 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
legendbooleantrue
legendPositionselect: top, bottom, left, righttop
swapLabelValuebooleanfalse
negativeColortext""
barBackgroundbooleanfalse
barSeparatorsbooleanfalse
barGaptext60
connectedColumnsbooleanfalse
connectionsOpacitytext0.15
waterfallbooleanfalse
waterfallTotalbooleanfalse
categoryLabelLinebooleanfalse
showVerticalAxisbooleanfalse
verticalAxisDirectionselect: left, rightleft
showVerticalTicksbooleanfalse
verticalLabelPositionselect: auto, inside, outside, offoff
verticalGridStyleselect: solid, dashed, dotted, nonenone
verticalNumberFormatnumberFormat(unset)
verticalScaleTypeselect: linear, loglinear
verticalRangeMintext(unset)
verticalRangeMaxtext(unset)
verticalTickValuestext(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

Overlays ​

Overlays add reference marks on each bar: a value mark (one extra column) or a range band (two extra columns), such as a confidence interval or last year's value. Overlay columns are not bars, so they never add bars or change the category count. With waterfall, each overlay is drawn relative to the running total at the start of its step, so the marks follow the floating bars. Overlay entries appear in a key under the chart.

Cues change the bars themselves. On a range overlay, muteIfCrosses = 0 fades every bar whose range includes zero. On a value overlay, aboveColor and belowColor color each bar by whether it reaches its mark, and add matching entries to the key.

See overlay for the keys and an example.

Common pitfalls ​

  • Truncating the y-axis exaggerates differences and misleads readers — always start at zero
  • Too many categories create visual clutter; group small ones into "Other"
  • 3D effects distort the encoding — Blueprint Chart doesn't offer them, and you shouldn't fake them
  • bar-horizontal — when labels are long or you want a ranked list
  • bar-multi — when you need to compare two or more series side by side
  • bar-stacked — when the parts of each bar sum to a meaningful total

See also ​

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