Column chart

Use a column chart to compare categories or ordered periods with vertical bars.

Every preview on this page is generated from the YAML shown below it using a fixed documentation dataset.

Basic

Use one ordered category and one measure for a direct vertical comparison. Ascending month order makes changes over time easy to scan.

Key fields
visuals:
  orders_by_month_column:
    title: Orders by month
    type: column
    query:
      dimensions:
        purchase_month: orders.purchase_month
      measures:
        order_count: null
      sort:
        - field: purchase_month
          direction: asc
      limit: 30

Stacked series

Map status through query.series and enable presentation.stacked to show both the monthly total and each status contribution.

Key fields
visuals:
  orders_by_month_status:
    title: Orders by month and status
    description: Compares monthly order volume split by status.
    type: column
    presentation:
      stacked: true
    query:
      dimensions:
        purchase_month: orders.purchase_month
      series:
        field: orders.status
        alias: status
      measures:
        order_count: null
      sort:
        - field: purchase_month
          direction: asc
      limit: 40

Grouped series

Keep the series unstacked to place statuses side by side, and use presentation.legend to position the series key above the plot.

Key fields
visuals:
  orders_by_month_status_grouped:
    title: Orders by month and status grouped
    type: column
    presentation:
      legend: bottom
    query:
      dimensions:
        purchase_month: orders.purchase_month
      series:
        field: orders.status
        alias: status
      measures:
        order_count: null
      sort:
        - field: purchase_month
          direction: asc
      limit: 60

API reference

Kind: chart. Renderer: echarts. Supported result shapes: category_series_value category_value.

FieldTypeDefaultAllowed valuesDescription
query.dimensionsfield mappingGroups query results and supplies category, hierarchy, matrix, graph, or geographic labels.
query.limitintegerno limitpositive integerCaps the number of rows returned to the renderer.
query.measuresmeasure mappingSelects the governed semantic measures consumed by the visual shape.
query.seriesfield referenceSplits one measure into named series for compatible chart shapes.
query.sortsort listOrders query results by a returned field or measure alias.
presentation.legendboolean | stringfalsetrue false top bottom left rightShows the legend and optionally selects its position.
presentation.stackedbooleanfalsetrue falseStacks compatible bar, column, line, or area series.

Accessibility. Use a descriptive title and unit, and do not rely on color alone to distinguish series or values.