Area chart

Use an area chart to emphasize the magnitude of a metric over an ordered category.

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 metric to fill the area between the series and its baseline. The ascending sort preserves the time sequence, and explicitly hidden labels leave the shape unobstructed.

Key fields
visuals:
  revenue:
    title: Revenue by month
    description: Tracks monthly revenue over the selected period.
    type: area
    presentation:
      type: cartesian
      labels:
        density: hidden
        priority: []
        maxCharacters: 24
        minimumSpacing: 0
        tooltipFallback: true
    query:
      type: aggregate
      dimensions:
      - purchase_month
      metrics:
      - revenue
      sort:
      - field: purchase_month
        direction: asc
      limit: 30

Stacked series

Use a second ordered dimension for status and set presentation.stacking: normal to show how each status contributes to the monthly total.

Key fields
visuals:
  revenue_area_status:
    title: Stacked revenue area
    type: area
    presentation:
      type: cartesian
      stacking: normal
    query:
      type: aggregate
      dimensions:
      - purchase_month
      - status
      metrics:
      - revenue
      sort:
      - field: purchase_month
        direction: asc
      limit: 60

Smoothed line

Enable presentation.smooth to interpolate the boundary, hide symbols to reduce clutter, and add dataZoom when the ordered range grows.

Key fields
visuals:
  revenue_area_smooth:
    title: Smooth revenue area
    type: area
    presentation:
      type: cartesian
      smooth: true
      showSymbols: false
      dataZoom: true
    query:
      type: aggregate
      dimensions:
      - purchase_month
      metrics:
      - revenue
      sort:
      - field: purchase_month
        direction: asc
      limit: 30

API reference

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

FieldTypeDefaultAllowed valuesDescription
query.dimensionsfield mappingGroups query results and supplies category or hierarchy labels.
query.limitintegerno limitpositive integerCaps the number of rows returned to the renderer.
query.metricsmetric mappingSelects governed semantic metrics consumed by the visual shape.
query.sortsort listOrders query results by a returned field or metric alias.
presentation.dataZoombooleanfalsetrue falseAdds bounded zoom controls to supported Cartesian charts.
presentation.labelslabel policyhiddenhidden automatic dense alwaysControls deterministic label density, priority, truncation, and tooltip fallback.
presentation.showSymbolsbooleantruetrue falseShows point symbols on compatible Cartesian charts.
presentation.smoothbooleantruetrue falseUses curved interpolation on compatible line and area charts.
presentation.stackingstringnonenone normal percentDeclares explicit normal or 100% stacking.

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