Skip to content

Chart Types

Dataface renders most charts through Vega-Lite, but authored chart YAML uses a typed Dataface surface. Choose one of the supported built-in chart types, use top-level Dataface fields such as x, y, color, theta, value, and href. Arbitrary Vega-Lite spec, mark, encoding, config, transform, params, and composition blocks are rejected on the authored surface.


Bar Chart

Best for: Comparing values across categories

charts:
  bar_example:
    query: _doc_examples.yaml#sales_by_product
    type: bar
    title: Revenue by Product
    x: product
    y: revenue
    color: category
rows:
  - bar_example
Gadget XGadget YTool ZWidget AWidget BProduct$0$5,000$10,000$15,000$20,000$25,000$30,000$35,000$40,000$45,000$50,000$55,000$60,000$65,000$70,000$75,000$80,000$85,000RevenueAccessoriesElectronicsToolscategoryRevenue by Product 2026-05-12 12:35
Field Required Description
x Yes Category field
y Yes Value field
color No Group by color

Horizontal Bar Chart

Use style.orientation: horizontal for horizontal bars - great for long category labels or ranked lists:

charts:
  horizontal_bar_example:
    query: _doc_examples.yaml#sales_by_product
    type: bar
    title: Revenue by Product
    x: product
    y: revenue
    style:
      orientation: horizontal
rows:
  - horizontal_bar_example
010,00020,00030,00040,00050,00060,00070,00080,0005,00015,00025,00035,00045,00055,00065,00075,00085,000RevenueGadget XGadget YTool ZWidget AWidget BProductRevenue by Product 2026-05-12 12:35
Style field Value Description
style.orientation horizontal Swaps x/y axes for horizontal bars

Line Graph

Best for: Trends over time

charts:
  line_example:
    query: _doc_examples.yaml#sales_by_date_product
    type: line
    title: Revenue Trend
    x: date
    y: revenue
    color: product
rows:
  - line_example
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 Trend 2026-05-12 12:35
Field Required Description
x Yes Time/category field
y Yes Value field
color No Series grouping

Area Chart

Best for: Stacked trends, showing composition over time

charts:
  area_example:
    query: _doc_examples.yaml#sales_by_date_category
    type: area
    title: Revenue by Category
    x: date
    y: revenue
    color: category
rows:
  - area_example
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$1,000$2,000$3,000$4,000$5,000$500$1,500$2,500$3,500$4,500$5,500RevenueAccessoriesElectronicsToolscategoryRevenue by Category 2026-05-12 12:35
Field Required Description
x Yes Time/category field
y Yes Value field
color No Stack grouping

Scatter Plot

Best for: Relationships between two metrics

charts:
  scatter_example:
    query: _doc_examples.yaml#sales
    type: scatter
    title: Revenue vs Units
    x: units_sold
    y: revenue
    color: category
rows:
  - scatter_example
010203040506070809051525354555657585Units Sold$800$900$1,000$1,100$1,200$1,300$1,400$1,500$1,600$1,700$1,800$1,900$2,000$2,100$2,200$2,300$2,400$2,500$2,600RevenueAccessoriesElectronicsToolscategoryRevenue vs Units 2026-05-12 12:35
Field Required Description
x Yes First metric
y Yes Second metric
color No Category grouping
size No Bubble size

Pie Charts

Best for: Part-to-whole relationships, proportions

charts:
  pie_example:
    query: _doc_examples.yaml#sales_by_category
    type: pie
    title: Revenue by Category
    theta: revenue
    color: category
  donut_example:
    query: _doc_examples.yaml#sales_by_category
    type: pie
    inner_radius: 0.5
    title: Units by Category
    theta: units_sold
    color: category
cols:
  - pie_example
  - donut_example
AccessoriesElectronicsToolscategoryRevenue by CategoryAccessoriesElectronicsToolscategoryUnits by Category 2026-05-12 12:35
Field Required Description
theta Yes Numeric value field (angle encoding)
color Yes Category field
inner_radius No Inner radius ratio (0–1). Use inner_radius: 0.5 for a donut appearance.

KPI Display

Best for: Single metric highlights, key numbers

charts:
  revenue_kpi:
    query: _doc_examples.yaml#sales_summary
    type: kpi
    label: Total Revenue
    value: revenue
  units_kpi:
    query: _doc_examples.yaml#sales_summary
    type: kpi
    label: Units Sold
    value: units_sold
cols:
  - revenue_kpi
  - units_kpi
850k Total Revenue 5.8k Units Sold 2026-05-12 12:35
Field Required Description
value Yes Column reference (string matching a column in the bound row) OR literal scalar (number/string) for the headline
glyph No Optional prefix glyph (e.g. , ) rendered ahead of the value
tone No Semantic styling — positive / negative / neutral / warning
label No Text rendered above the headline value (KPI uses label: instead of title:)
support No Trailing line with the same shape: { value, label, format, glyph, tone }
format No Number format. Defaults to compact editorial notation (1.50mn); override notation: bi for the dense register

KPI charts require a query that returns exactly 1 row when value: is a column reference (e.g. SELECT SUM(revenue) as revenue). Status-style KPIs use a literal: value: "At risk".


Table

Best for: Detailed data view, exact values

charts:
  table_example:
    query: _doc_examples.yaml#sales
    type: table
    title: Sales Data
rows:
  - table_example
Sales DataDateRegionProductCategoryRevenueUnits Sold2024-01-01NorthWidget AElectronics1,500502024-01-01SouthWidget BElectronics2,200802024-01-01EastGadget XAccessories850252024-01-01WestWidget AElectronics1,800602024-01-02NorthGadget YAccessories1,200402024-01-02SouthWidget BElectronics2,400902024-01-02EastTool ZTools950302024-01-02WestWidget AElectronics1,600552024-01-03NorthGadget XAccessories1,100352024-01-03SouthWidget BElectronics2,100752024-01-03EastTool ZTools1,300452024-01-03WestWidget AElectronics1,900652024-01-04NorthGadget YAccessories1,400502024-01-04SouthWidget BElectronics2,300852024-01-04EastTool ZTools1,050352024-01-04WestWidget AElectronics1,750582024-01-05NorthWidget AElectronics1,650552024-01-05SouthGadget XAccessories920282024-01-05EastWidget BElectronics2,050722024-01-05WestTool ZTools1,15038 Page 1 of 8 2026-05-12 12:35

Tables automatically format numbers, convert snake_case headers to Title Case, and show a "more rows" indicator when data is truncated.


  • Line Graphs - Detailed line-graph surface and Vega-Lite mapping
  • Pie Charts - Detailed pie surface and Vega-Lite mapping
  • Maps - Choropleth, point, and bubble maps for geographic data
  • More Chart Types - Heatmaps, histograms, and all Vega-Lite marks
  • Charts Overview - Field reference and styling
  • Interactions - Hover tooltips and href: click-through links