Line chart
Use a line chart to show a measure changing across an ordered category such as time.
Every preview on this page is generated from the YAML shown below it using a fixed documentation dataset.
Basic
Use one ordered query.dimensions field for the horizontal axis and one query.measures field for the plotted value. Sorting by month keeps the line chronological.
visuals:
revenue_line:
title: Revenue line by month
type: line
query:
dimensions:
purchase_month: orders.purchase_month
measures:
revenue: null
sort:
- field: purchase_month
direction: asc
limit: 30
Multiple series
Map query.series to split the measure into one line per order status; the compiler derives the required series-aware Cartesian specification.
visuals:
revenue_line_status:
title: Revenue line by status
type: line
query:
dimensions:
purchase_month: orders.purchase_month
series:
field: orders.status
alias: status
measures:
revenue: null
sort:
- field: purchase_month
direction: asc
limit: 60
Stepped line
Set presentation.step: true for discrete changes between periods, hide point symbols for a quieter trace, and enable data_zoom for long ranges.
visuals:
revenue_line_step:
title: Stepped revenue line
type: line
presentation:
step: true
show_symbols: false
data_zoom: true
query:
dimensions:
purchase_month: orders.purchase_month
measures:
revenue: null
sort:
- field: purchase_month
direction: asc
limit: 30
API reference
Kind: chart. Renderer: echarts. Supported result shapes: category_series_value category_value.
| Field | Type | Default | Allowed values | Description |
|---|---|---|---|---|
query.dimensions | field mapping | — | — | Groups query results and supplies category, hierarchy, matrix, graph, or geographic labels. |
query.limit | integer | no limit | positive integer | Caps the number of rows returned to the renderer. |
query.measures | measure mapping | — | — | Selects the governed semantic measures consumed by the visual shape. |
query.series | field reference | — | — | Splits one measure into named series for compatible chart shapes. |
query.sort | sort list | — | — | Orders query results by a returned field or measure alias. |
presentation.data_zoom | boolean | false | true false | Adds inside and slider zoom controls to supported Cartesian charts. |
presentation.show_symbols | boolean | true | true false | Shows point symbols on line and area series. |
presentation.step | boolean | false | true false | Draws line segments as discrete steps. |
Accessibility. Use a descriptive title and unit, and do not rely on color alone to distinguish series or values.