Candlestick chart

Use a candlestick chart to compare open, close, low, and high measures across an ordered category.

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

Delivery range

Use the ohlc shape with an ordered month dimension and a numeric measure to summarize each period as open, high, low, and close values.

Key fields
visuals:
  delivery_candlestick:
    title: Delivery day candlestick by month
    type: candlestick
    query:
      dimensions:
        purchase_month: orders.purchase_month
      measures:
        delivery_days_q1: null
        delivery_days_q3: null
        delivery_days_min: null
        delivery_days_max: null
      sort:
        - field: purchase_month
          direction: asc
      limit: 30

Revenue range

Change the measure to revenue and enable presentation.data_zoom so dense monthly ranges remain explorable without changing the OHLC contract.

Key fields
visuals:
  revenue_candlestick:
    title: Revenue OHLC by month
    type: candlestick
    presentation:
      data_zoom: true
    query:
      dimensions:
        purchase_month: orders.purchase_month
      measures:
        revenue_q1: null
        revenue_q3: null
        revenue_min: null
        revenue_max: null
      sort:
        - field: purchase_month
          direction: asc
      limit: 30

API reference

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

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.

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