viz.bar

Bar chart of a value per category.

  • Kind: standard
  • Network: no

Inputs🔗

NameTypeRequiredDefaultDescription
tablefile (Parquet)yesTable to chart (Parquet or CSV).
xstringyesCategory column.
ystringyesValue column.
aggregatestringnosumHow to combine rows sharing a category. One of sum, mean, median, min, max, count, none.
colorstringnoblankColumn to colour bars by.
stackbooleannoTrueStack coloured bars; otherwise group them side by side.
horizontalbooleannoFalseDraw bars horizontally.
titlestringnoblankChart title. ${item.key} labels each chart inside a map.
widthnumberno600Width in pixels.
heightnumberno400Height in pixels.
formatstringnopngImage format. html is a static, self-contained page. One of png, svg, html.

Outputs🔗

NameTypeDescription
chartfile (PNG)The rendered chart.
specjson (Vega-Lite)The Vega-Lite spec the block built; edit it and render with viz.vegalite.

Example🔗

- id: "@bar"
  name: viz.bar
  inputs: [{block: "@plots", output: result, as: table}]
  args:
    x: species
    y: biomass
    aggregate: sum
    title: ''
    format: png