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
swapLabelValuebooleanfalse
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)
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 ​

  • 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.