Waterfall chart

Use a waterfall chart to show how category contributions build from one total to another.

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

Basic

Use an ordered dimension and one measure with type: waterfall; the compiler derives the cumulative fields needed to show how each period contributes to the running total.

Key fields
visuals:
  revenue_waterfall:
    title: Monthly revenue contribution
    description: Shows each month contribution to total revenue.
    type: waterfall
    query:
      dimensions:
        purchase_month: orders.purchase_month
      measures:
        revenue: null
      sort:
        - field: purchase_month
          direction: asc
      limit: 18

Alternate measure

Replace revenue with order count to reuse the same running-contribution structure for volume rather than value.

Key fields
visuals:
  orders_waterfall:
    title: Monthly order contribution
    type: waterfall
    query:
      dimensions:
        purchase_month: orders.purchase_month
      measures:
        order_count: null
      sort:
        - field: purchase_month
          direction: asc
      limit: 18

Labels and zoom

Enable show_labels for exact contributions and data_zoom when many categories make the running sequence too dense.

Key fields
visuals:
  revenue_waterfall_labeled:
    title: Labeled revenue waterfall
    type: waterfall
    presentation:
      show_labels: true
      data_zoom: true
    query:
      dimensions:
        category: orders.category
      measures:
        revenue: null
      sort:
        - field: value
          direction: desc
      limit: 12

API reference

Kind: chart. Renderer: echarts. Supported result shapes: category_delta.

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.sortsort listOrders query results by a returned field or measure alias.
presentation.data_zoombooleanfalsetrue falseAdds inside and slider zoom controls to supported Cartesian charts.
presentation.show_labelsbooleanfalsetrue falseShows value labels directly on chart marks.

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