Skip to content

Line Graphs

Line graphs connect values across an ordered axis, usually time, to emphasize continuity, direction, rate of change, and overall shape; this family includes single- or multi-series lines and slope graphs. They are most useful when the main question is how something changes over time rather than how big isolated categories are.

Dataface line graphs use a small set of top-level shorthand fields together with style. In most cases, you only need query, type: line, x, and y to get started.

A chart's control surface is the full set of authored properties available on a single chart. In Dataface, that surface is primarily top-level chart fields plus typed style objects.

This page is intentionally family-oriented rather than exhaustive. For the implementation-backed source of truth, including default ownership and lower-level property coverage, see the Single-Chart Property Catalog.


Minimum Required for a Line Graph

These are the minimum fields required to render a basic line graph in Dataface.

Dataface field Maps to Vega-Lite Allowed values Notes
query data.values Query name or query reference Supplies the dataset.
type: line mark.type: "line" Literal line Selects the line mark.
x encoding.x.field Field name Ordered dimension, usually time.
y encoding.y.field Field name Numeric measure to plot.

Minimum Example

charts:
  revenue_trend_minimal:
    query: _doc_examples.yaml#sales_by_date
    type: line
    title: Daily Revenue
    x: date
    y: revenue
rows:
  - revenue_trend_minimal
1 Jan20242 Jan3 Jan4 Jan5 Jan6 Jan7 Jan8 Jan9 Jan10 Jan11 Jan12 Jan13 Jan14 Jan15 Jan16 Jan17 Jan18 Jan19 Jan20 Jan21 Jan22 Jan23 Jan24 Jan25 Jan26 Jan27 Jan28 Jan29 Jan30 Jan31 Jan1 Feb2 Feb3 Feb4 Feb5 Feb6 Feb7 FebDate$0$500$1,000$1,500$2,000$2,500$3,000$3,500$4,000$4,500$5,000$5,500$6,000$6,500$7,000RevenueDaily Revenue 2026-05-12 12:35

Top-Level Chart Fields

These are the top-level chart properties you set directly on a line graph before you get into nested properties under style.

Dataface field Maps to Vega-Lite Allowed values Notes
query data.values Query name or query reference Query results become the plotted dataset.
type: line mark.type: "line" Literal line Selects the line mark.
x encoding.x.field Field name Usually a temporal or ordered field.
y encoding.y.field Field name or list of field names A list creates layered multi-metric lines.
title title.text String Chart title.
description metadata String Available for tooling and docs.
color encoding.color.field Field name Groups a line into multiple series.
x_label encoding.x.title String Custom x-axis title.
y_label encoding.y.title String Custom y-axis title.
format encoding.y.format and encoding.y.axis.format Format string Numeric formatting for the y channel.
sort categorical axis sort Sort object Most useful when the x-axis is categorical.
projection top-level projection Vega-Lite projection name Available for Vega-Lite projection overrides.

Multi-Series Line Graph

This example adds color to split one line into multiple series while keeping the top-level chart definition compact.

charts:
  revenue_by_product:
    query: _doc_examples.yaml#sales_by_date_product
    type: line
    title: Revenue by Product
    x: date
    y: revenue
    color: product
rows:
  - revenue_by_product
1 Jan20242 Jan3 Jan4 Jan5 Jan6 Jan7 Jan8 Jan9 Jan10 Jan11 Jan12 Jan13 Jan14 Jan15 Jan16 Jan17 Jan18 Jan19 Jan20 Jan21 Jan22 Jan23 Jan24 Jan25 Jan26 Jan27 Jan28 Jan29 Jan30 Jan31 Jan1 Feb2 Feb3 Feb4 Feb5 Feb6 Feb7 FebDate$0$200$400$600$800$1,000$1,200$1,400$1,600$1,800$2,000$2,200$2,400$2,600$2,800$3,000$3,200$3,400RevenueGadget XGadget YTool ZWidget AWidget BproductRevenue by Product 2026-05-12 12:35

Axis Labels, Formatting, and Styling

This example shows common top-level chart fields such as labels and numeric formatting.

charts:
  revenue_formatted:
    query: _doc_examples.yaml#sales_by_date
    type: line
    title: Revenue Over Time
    x: date
    y: revenue
    x_label: Date
    y_label: Revenue
    format: "$,.0f"
    style:
      scale:
        zero: false
      axis:
        grid:
          hidden: true
rows:
  - revenue_formatted
1 Jan20242 Jan3 Jan4 Jan5 Jan6 Jan7 Jan8 Jan9 Jan10 Jan11 Jan12 Jan13 Jan14 Jan15 Jan16 Jan17 Jan18 Jan19 Jan20 Jan21 Jan22 Jan23 Jan24 Jan25 Jan26 Jan27 Jan28 Jan29 Jan30 Jan31 Jan1 Feb2 Feb3 Feb4 Feb5 Feb6 Feb7 FebDate$5,700$5,750$5,800$5,850$5,900$5,950$6,000$6,050$6,100$6,150$6,200$6,250$6,300$6,350$6,400$6,450$6,500$6,550$6,600RevenueRevenue Over Time 2026-05-12 12:35

Layered Multi-Metric Lines

When y is a list, Dataface creates a layered line graph. This is useful when you want to compare two measures that share the same ordered x-axis.

charts:
  revenue_and_units:
    query: _doc_examples.yaml#sales_by_date
    type: line
    title: Revenue And Units Sold
    x: date
    y: [revenue, units_sold]
rows:
  - revenue_and_units
1 Jan20242 Jan3 Jan4 Jan5 Jan6 Jan7 Jan8 Jan9 Jan10 Jan11 Jan12 Jan13 Jan14 Jan15 Jan16 Jan17 Jan18 Jan19 Jan20 Jan21 Jan22 Jan23 Jan24 Jan25 Jan26 Jan27 Jan28 Jan29 Jan30 Jan31 Jan1 Feb2 Feb3 Feb4 Feb5 Feb6 Feb7 FebDate$0$500$1,000$1,500$2,000$2,500$3,000$3,500$4,000$4,500$5,000$5,500$6,000$6,500$7,000Revenue, Units SoldRevenueUnits SoldRevenue And Units Sold 2026-05-12 12:35

Style Fields

Use style for Dataface shorthand properties that affect presentational defaults such as legend visibility and grid lines.

Dataface field Maps to Vega-Lite Allowed values Notes
style.legend.disable encoding.color.legend true or false Typed legend control. true hides the legend.
style.axis.grid axis grid flags true or false Typed grid visibility control.
style.background chart SVG background wrapper Color value Applies a chart-level background fill behind the rendered SVG.

Legend and Grid Lines

This example shows the small style surface for line graphs without changing the underlying data bindings.

charts:
  revenue_formatted:
    query: _doc_examples.yaml#sales_by_date
    type: line
    title: Revenue Over Time
    x: date
    y: revenue
    x_label: Date
    y_label: Revenue
    format: "$,.0f"
    style:
      scale:
        zero: false
      axis:
        grid:
          hidden: true
rows:
  - revenue_formatted
1 Jan20242 Jan3 Jan4 Jan5 Jan6 Jan7 Jan8 Jan9 Jan10 Jan11 Jan12 Jan13 Jan14 Jan15 Jan16 Jan17 Jan18 Jan19 Jan20 Jan21 Jan22 Jan23 Jan24 Jan25 Jan26 Jan27 Jan28 Jan29 Jan30 Jan31 Jan1 Feb2 Feb3 Feb4 Feb5 Feb6 Feb7 FebDate$5,700$5,750$5,800$5,850$5,900$5,950$6,000$6,050$6,100$6,150$6,200$6,250$6,300$6,350$6,400$6,450$6,500$6,550$6,600RevenueRevenue Over Time 2026-05-12 12:35

Axis and Scale Style

Use style for axis and scale properties that shape how the line graph is framed and read.

Dataface field Maps to Vega-Lite Allowed values Notes
style.axis_x config.axisX / encoding.x.axis AxisStyle object Per-axis styling (format, ticks, labels, grid, title).
style.axis_y config.axisY / encoding.y.axis AxisStyle object Per-axis styling.
style.scale config.scale ScaleStyle object Global scale config (zero, nice, domain, clamp).

Axis and Scale Controls

This example uses style to control the y-axis scale and tick density.

charts:
  revenue_formatted:
    query: _doc_examples.yaml#sales_by_date
    type: line
    title: Revenue Over Time
    x: date
    y: revenue
    x_label: Date
    y_label: Revenue
    format: "$,.0f"
    style:
      scale:
        zero: false
      axis:
        grid:
          hidden: true
rows:
  - revenue_formatted
1 Jan20242 Jan3 Jan4 Jan5 Jan6 Jan7 Jan8 Jan9 Jan10 Jan11 Jan12 Jan13 Jan14 Jan15 Jan16 Jan17 Jan18 Jan19 Jan20 Jan21 Jan22 Jan23 Jan24 Jan25 Jan26 Jan27 Jan28 Jan29 Jan30 Jan31 Jan1 Feb2 Feb3 Feb4 Feb5 Feb6 Feb7 FebDate$5,700$5,750$5,800$5,850$5,900$5,950$6,000$6,050$6,100$6,150$6,200$6,250$6,300$6,350$6,400$6,450$6,500$6,550$6,600RevenueRevenue Over Time 2026-05-12 12:35

Endpoint Labels

Set style.line.endpoint_labels.enabled: true on a multi-series line graph to move the series names off the side legend and onto the chart, anchored to each line's final point. The chart pane and label pane sit side-by-side in an hconcat, with one label per series.

Dataface field Allowed values Notes
style.line.endpoint_labels.enabled true or false Opt-in feature toggle. Defaults to false on the standard theme, true on editorial themes.

When the label pane is on, the categorical legend turns off automatically — the two would encode the same series→colour mapping twice. The y-axis also auto-flips to the left so it doesn't collide with the right-edge label pane.

Endpoint labels require a color channel (a multi-series chart); on single-series lines there's only one series to name, so the feature is a no-op.

charts:
  revenue_by_product:
    query: _doc_examples.yaml#sales_by_date_product
    type: line
    title: Revenue by Product
    x: date
    y: revenue
    color: product
    style:
      line:
        endpoint_labels:
          enabled: true

rows:
  - revenue_by_product
1 Jan20242 Jan3 Jan4 Jan5 Jan6 Jan7 Jan8 Jan9 Jan10 Jan11 Jan12 Jan13 Jan14 Jan15 Jan16 Jan17 Jan18 Jan19 Jan20 Jan21 Jan22 Jan23 Jan24 Jan25 Jan26 Jan27 Jan28 Jan29 Jan30 Jan31 Jan1 Feb2 Feb3 Feb4 Feb5 Feb6 Feb7 FebDate$0$200$400$600$800$1,000$1,200$1,400$1,600$1,800$2,000$2,200$2,400$2,600$2,800$3,000$3,200$3,400RevenueRevenue by ProductWidget BWidget AGadget YTool Z 2026-05-12 12:35

Authored Surface

Dataface line charts are authored with type: line plus top-level channels such as x, y, and color. Arbitrary Vega-Lite spec, mark, encoding, config, transform, params, and composition blocks are rejected on the authored surface. Use top-level Dataface fields and the typed style: object.