Skip to content
OpenChart

Dashboard tiles

Compact chart forms for dense layouts, from sparklines and short charts to metric rows, bar lists and condensed tables, as single specs.

A dashboard tile is the same spec as a standalone chart, sized and stripped down for a card. This page covers the forms a spec can take in a small box. It does not build the layout around them; the grid, the headline numbers and the card surface are yours.

For a full-size chart with editorial chrome, use the bar or line pages instead. A tile leaves out the chrome the card already supplies.

Area sparkline

display: "sparkline" strips chrome, axes, legend and watermark, so a tiny trend fits next to a number you render yourself. This figure is a 56px box; sparklines are usually mounted in 36 to 56px.

An area sparkline. Source: Illustrative data.
{
  "mark": "area",
  "data": [
    {
      "t": 0,
      "value": 4180
    },
    {
      "t": 1,
      "value": 4195.53
    },
    {
      "t": 2,
      "value": 4186.73
    },
    {
      "t": 3,
      "value": 4194.96
    },
    {
      "t": 4,
      "value": 4184.79
    },
    {
      "t": 5,
      "value": 4170.74
    },
    // … 34 more rows; Copy includes them
  ],
  "encoding": {
    "x": {
      "field": "t",
      "type": "ordinal"
    },
    "y": {
      "field": "value",
      "type": "quantitative"
    }
  },
  "display": "sparkline"
}
import { Chart } from "@opendata-ai/openchart-react";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 40 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": "area",
  "encoding": {
    "x": {
      "field": "t",
      "type": "ordinal"
    },
    "y": {
      "field": "value",
      "type": "quantitative"
    }
  },
  "display": "sparkline"
};

export function Example() {
  return <Chart spec={spec} />;
}
<script setup lang="ts">
import { Chart } from "@opendata-ai/openchart-vue";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 40 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": "area",
  "encoding": {
    "x": {
      "field": "t",
      "type": "ordinal"
    },
    "y": {
      "field": "value",
      "type": "quantitative"
    }
  },
  "display": "sparkline"
};
</script>

<template>
  <Chart :spec="spec" />
</template>
<script lang="ts">
import { Chart } from "@opendata-ai/openchart-svelte";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 40 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": "area",
  "encoding": {
    "x": {
      "field": "t",
      "type": "ordinal"
    },
    "y": {
      "field": "value",
      "type": "quantitative"
    }
  },
  "display": "sparkline"
};
</script>

<Chart {spec} />
import { createChart } from "@opendata-ai/openchart-vanilla";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 40 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": "area",
  "encoding": {
    "x": {
      "field": "t",
      "type": "ordinal"
    },
    "y": {
      "field": "value",
      "type": "quantitative"
    }
  },
  "display": "sparkline"
};

const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createChart(container, spec);

Line sparkline

The same display setting works on a line mark. Without a color, a sparkline takes the trend color: positive when the series rises, negative when it falls. An explicit stroke sets your own color instead.

A line sparkline with an explicit stroke. Source: Illustrative data.
{
  "mark": {
    "type": "line",
    "stroke": "#0e7490"
  },
  "data": [
    {
      "t": 0,
      "value": 1965
    },
    {
      "t": 1,
      "value": 1970.2
    },
    {
      "t": 2,
      "value": 1979.27
    },
    {
      "t": 3,
      "value": 1991.22
    },
    {
      "t": 4,
      "value": 1980.98
    },
    {
      "t": 5,
      "value": 1989.94
    },
    // … 34 more rows; Copy includes them
  ],
  "encoding": {
    "x": {
      "field": "t",
      "type": "ordinal"
    },
    "y": {
      "field": "value",
      "type": "quantitative"
    }
  },
  "display": "sparkline"
}
import { Chart } from "@opendata-ai/openchart-react";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 40 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": {
    "type": "line",
    "stroke": "#0e7490"
  },
  "encoding": {
    "x": {
      "field": "t",
      "type": "ordinal"
    },
    "y": {
      "field": "value",
      "type": "quantitative"
    }
  },
  "display": "sparkline"
};

export function Example() {
  return <Chart spec={spec} />;
}
<script setup lang="ts">
import { Chart } from "@opendata-ai/openchart-vue";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 40 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": {
    "type": "line",
    "stroke": "#0e7490"
  },
  "encoding": {
    "x": {
      "field": "t",
      "type": "ordinal"
    },
    "y": {
      "field": "value",
      "type": "quantitative"
    }
  },
  "display": "sparkline"
};
</script>

<template>
  <Chart :spec="spec" />
</template>
<script lang="ts">
import { Chart } from "@opendata-ai/openchart-svelte";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 40 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": {
    "type": "line",
    "stroke": "#0e7490"
  },
  "encoding": {
    "x": {
      "field": "t",
      "type": "ordinal"
    },
    "y": {
      "field": "value",
      "type": "quantitative"
    }
  },
  "display": "sparkline"
};
</script>

<Chart {spec} />
import { createChart } from "@opendata-ai/openchart-vanilla";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 40 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": {
    "type": "line",
    "stroke": "#0e7490"
  },
  "encoding": {
    "x": {
      "field": "t",
      "type": "ordinal"
    },
    "y": {
      "field": "value",
      "type": "quantitative"
    }
  },
  "display": "sparkline"
};

const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createChart(container, spec);

A short chart

A chart’s container height decides what it keeps. Below 150px the engine drops gridlines by default, below 200px it drops the axes, and a title still renders from 100px. This tile is 180px, so it shows the title and the columns with no axes. An explicit axis on a channel keeps its axis at any size. watermark: false leaves the brand band for the one hero chart on a dashboard.

35327530317527220611414225412227256Payroll additions, 202435327530317527220611414225412227256Payroll additions, 2024
A column chart in a 180px tile. Source: Bureau of Labor Statistics.
{
  "mark": "bar",
  "data": [
    {
      "month": "Jan",
      "jobs": 353
    },
    {
      "month": "Feb",
      "jobs": 275
    },
    {
      "month": "Mar",
      "jobs": 303
    },
    {
      "month": "Apr",
      "jobs": 175
    },
    {
      "month": "May",
      "jobs": 272
    },
    {
      "month": "Jun",
      "jobs": 206
    },
    {
      "month": "Jul",
      "jobs": 114
    },
    {
      "month": "Aug",
      "jobs": 142
    },
    {
      "month": "Sep",
      "jobs": 254
    },
    {
      "month": "Oct",
      "jobs": 12
    },
    {
      "month": "Nov",
      "jobs": 227
    },
    {
      "month": "Dec",
      "jobs": 256
    }
  ],
  "encoding": {
    "x": {
      "field": "month",
      "type": "nominal"
    },
    "y": {
      "field": "jobs",
      "type": "quantitative"
    }
  },
  "watermark": false,
  "chrome": {
    "title": "Payroll additions, 2024"
  }
}
import { Chart } from "@opendata-ai/openchart-react";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 12 rows, as in the Spec tab; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": "bar",
  "encoding": {
    "x": {
      "field": "month",
      "type": "nominal"
    },
    "y": {
      "field": "jobs",
      "type": "quantitative"
    }
  },
  "watermark": false,
  "chrome": {
    "title": "Payroll additions, 2024"
  }
};

export function Example() {
  return <Chart spec={spec} />;
}
<script setup lang="ts">
import { Chart } from "@opendata-ai/openchart-vue";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 12 rows, as in the Spec tab; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": "bar",
  "encoding": {
    "x": {
      "field": "month",
      "type": "nominal"
    },
    "y": {
      "field": "jobs",
      "type": "quantitative"
    }
  },
  "watermark": false,
  "chrome": {
    "title": "Payroll additions, 2024"
  }
};
</script>

<template>
  <Chart :spec="spec" />
</template>
<script lang="ts">
import { Chart } from "@opendata-ai/openchart-svelte";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 12 rows, as in the Spec tab; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": "bar",
  "encoding": {
    "x": {
      "field": "month",
      "type": "nominal"
    },
    "y": {
      "field": "jobs",
      "type": "quantitative"
    }
  },
  "watermark": false,
  "chrome": {
    "title": "Payroll additions, 2024"
  }
};
</script>

<Chart {spec} />
import { createChart } from "@opendata-ai/openchart-vanilla";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 12 rows, as in the Spec tab; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": "bar",
  "encoding": {
    "x": {
      "field": "month",
      "type": "nominal"
    },
    "y": {
      "field": "jobs",
      "type": "quantitative"
    }
  },
  "watermark": false,
  "chrome": {
    "title": "Payroll additions, 2024"
  }
};

const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createChart(container, spec);

A metrics row

metrics renders a row of label and value cells between the subtitle and the plot, tied to the chart below it. Use it when the numbers summarize that chart. For headline numbers that belong to no single chart, render plain HTML cards beside it.

202320242025$50$100$150$200Share priceNVIDIA at a glanceNVDA monthly close with headline stats, Jan 2023 to Dec 2025CLOSE$186.5052-WK HIGH$202.4852-WK LOW$108.363-YR RETURN+855%9.6×202320242025$50$100$150$200Share priceNVIDIA at a glanceNVDA monthly close with headline stats, Jan 2023 to Dec 2025CLOSE$186.5052-WK HIGH$202.4852-WK LOW$108.363-YR RETURN+855%9.6×
A chart with a metrics row. Source: Nasdaq historical data.
{
  "mark": {
    "type": "area",
    "stroke": "#0e7490",
    "strokeWidth": 2
  },
  "data": [
    {
      "date": "2023-01-01",
      "price": 19.52
    },
    {
      "date": "2023-02-01",
      "price": 23.19
    },
    {
      "date": "2023-03-01",
      "price": 27.75
    },
    {
      "date": "2023-04-01",
      "price": 27.73
    },
    {
      "date": "2023-05-01",
      "price": 37.8
    },
    {
      "date": "2023-06-01",
      "price": 42.27
    },
    // … 30 more rows; Copy includes them
  ],
  "encoding": {
    "x": {
      "field": "date",
      "type": "temporal",
      "axis": {
        "tickCount": 4
      }
    },
    "y": {
      "field": "price",
      "type": "quantitative",
      "axis": {
        "title": "Share price",
        "format": "$,.0f"
      },
      "scale": {
        "zero": false
      }
    }
  },
  "metrics": [
    {
      "label": "Close",
      "value": "$186.50"
    },
    {
      "label": "52-wk high",
      "value": "$202.48"
    },
    {
      "label": "52-wk low",
      "value": "$108.36"
    },
    {
      "label": "3-yr return",
      "value": "+855%",
      "delta": "9.6×",
      "deltaTone": "up"
    }
  ],
  "labels": {
    "density": "none"
  },
  "chrome": {
    "title": "NVIDIA at a glance",
    "subtitle": "NVDA monthly close with headline stats, Jan 2023 to Dec 2025"
  }
}
import { Chart } from "@opendata-ai/openchart-react";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 36 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": {
    "type": "area",
    "stroke": "#0e7490",
    "strokeWidth": 2
  },
  "encoding": {
    "x": {
      "field": "date",
      "type": "temporal",
      "axis": {
        "tickCount": 4
      }
    },
    "y": {
      "field": "price",
      "type": "quantitative",
      "axis": {
        "title": "Share price",
        "format": "$,.0f"
      },
      "scale": {
        "zero": false
      }
    }
  },
  "metrics": [
    {
      "label": "Close",
      "value": "$186.50"
    },
    {
      "label": "52-wk high",
      "value": "$202.48"
    },
    {
      "label": "52-wk low",
      "value": "$108.36"
    },
    {
      "label": "3-yr return",
      "value": "+855%",
      "delta": "9.6×",
      "deltaTone": "up"
    }
  ],
  "labels": {
    "density": "none"
  },
  "chrome": {
    "title": "NVIDIA at a glance",
    "subtitle": "NVDA monthly close with headline stats, Jan 2023 to Dec 2025"
  }
};

export function Example() {
  return <Chart spec={spec} />;
}
<script setup lang="ts">
import { Chart } from "@opendata-ai/openchart-vue";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 36 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": {
    "type": "area",
    "stroke": "#0e7490",
    "strokeWidth": 2
  },
  "encoding": {
    "x": {
      "field": "date",
      "type": "temporal",
      "axis": {
        "tickCount": 4
      }
    },
    "y": {
      "field": "price",
      "type": "quantitative",
      "axis": {
        "title": "Share price",
        "format": "$,.0f"
      },
      "scale": {
        "zero": false
      }
    }
  },
  "metrics": [
    {
      "label": "Close",
      "value": "$186.50"
    },
    {
      "label": "52-wk high",
      "value": "$202.48"
    },
    {
      "label": "52-wk low",
      "value": "$108.36"
    },
    {
      "label": "3-yr return",
      "value": "+855%",
      "delta": "9.6×",
      "deltaTone": "up"
    }
  ],
  "labels": {
    "density": "none"
  },
  "chrome": {
    "title": "NVIDIA at a glance",
    "subtitle": "NVDA monthly close with headline stats, Jan 2023 to Dec 2025"
  }
};
</script>

<template>
  <Chart :spec="spec" />
</template>
<script lang="ts">
import { Chart } from "@opendata-ai/openchart-svelte";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 36 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": {
    "type": "area",
    "stroke": "#0e7490",
    "strokeWidth": 2
  },
  "encoding": {
    "x": {
      "field": "date",
      "type": "temporal",
      "axis": {
        "tickCount": 4
      }
    },
    "y": {
      "field": "price",
      "type": "quantitative",
      "axis": {
        "title": "Share price",
        "format": "$,.0f"
      },
      "scale": {
        "zero": false
      }
    }
  },
  "metrics": [
    {
      "label": "Close",
      "value": "$186.50"
    },
    {
      "label": "52-wk high",
      "value": "$202.48"
    },
    {
      "label": "52-wk low",
      "value": "$108.36"
    },
    {
      "label": "3-yr return",
      "value": "+855%",
      "delta": "9.6×",
      "deltaTone": "up"
    }
  ],
  "labels": {
    "density": "none"
  },
  "chrome": {
    "title": "NVIDIA at a glance",
    "subtitle": "NVDA monthly close with headline stats, Jan 2023 to Dec 2025"
  }
};
</script>

<Chart {spec} />
import { createChart } from "@opendata-ai/openchart-vanilla";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 36 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": {
    "type": "area",
    "stroke": "#0e7490",
    "strokeWidth": 2
  },
  "encoding": {
    "x": {
      "field": "date",
      "type": "temporal",
      "axis": {
        "tickCount": 4
      }
    },
    "y": {
      "field": "price",
      "type": "quantitative",
      "axis": {
        "title": "Share price",
        "format": "$,.0f"
      },
      "scale": {
        "zero": false
      }
    }
  },
  "metrics": [
    {
      "label": "Close",
      "value": "$186.50"
    },
    {
      "label": "52-wk high",
      "value": "$202.48"
    },
    {
      "label": "52-wk low",
      "value": "$108.36"
    },
    {
      "label": "3-yr return",
      "value": "+855%",
      "delta": "9.6×",
      "deltaTone": "up"
    }
  ],
  "labels": {
    "density": "none"
  },
  "chrome": {
    "title": "NVIDIA at a glance",
    "subtitle": "NVDA monthly close with headline stats, Jan 2023 to Dec 2025"
  }
};

const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createChart(container, spec);

A bar list in a card

A barlist spec is the densest way to show a ranked list in a tile: inline bars and no axes. barHeight thins the bars and watermark: false keeps the card clean.

Top languagesLanguage popularity index, % sharePythonPython: 23.423.4JavaJava: 17.117.1JavaScriptJavaScript: 14.914.9C/C++C/C++: 11.211.2C#C#: 8.68.6GoGo: 5.85.8TypeScriptTypeScript: 5.35.3RustRust: 4.14.1Top languagesLanguage popularity index, % sharePythonPython: 23.423.4JavaJava: 17.117.1JavaScriptJavaScript: 14.914.9C/C++C/C++: 11.211.2C#C#: 8.68.6GoGo: 5.85.8TypeScriptTypeScript: 5.35.3RustRust: 4.14.1
A bar list in a card. Source: TIOBE Index.
{
  "type": "barlist",
  "data": [
    {
      "language": "Python",
      "pct": 23.4,
      "category": "general"
    },
    {
      "language": "Java",
      "pct": 17.1,
      "category": "general"
    },
    {
      "language": "JavaScript",
      "pct": 14.9,
      "category": "web"
    },
    {
      "language": "C/C++",
      "pct": 11.2,
      "category": "systems"
    },
    {
      "language": "C#",
      "pct": 8.6,
      "category": "general"
    },
    {
      "language": "Go",
      "pct": 5.8,
      "category": "systems"
    },
    {
      "language": "TypeScript",
      "pct": 5.3,
      "category": "web"
    },
    {
      "language": "Rust",
      "pct": 4.1,
      "category": "systems"
    }
  ],
  "encoding": {
    "label": {
      "field": "language",
      "type": "nominal"
    },
    "value": {
      "field": "pct",
      "type": "quantitative",
      "format": ".1f"
    },
    "color": {
      "field": "category",
      "type": "nominal"
    }
  },
  "barHeight": 8,
  "watermark": false,
  "chrome": {
    "title": "Top languages",
    "subtitle": "Language popularity index, % share"
  }
}
import { BarList } from "@opendata-ai/openchart-react";
import type { BarListSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 8 rows, as in the Spec tab; Copy includes them */];

const spec: BarListSpec = {
  data,
  "type": "barlist",
  "encoding": {
    "label": {
      "field": "language",
      "type": "nominal"
    },
    "value": {
      "field": "pct",
      "type": "quantitative",
      "format": ".1f"
    },
    "color": {
      "field": "category",
      "type": "nominal"
    }
  },
  "barHeight": 8,
  "watermark": false,
  "chrome": {
    "title": "Top languages",
    "subtitle": "Language popularity index, % share"
  }
};

export function Example() {
  return <BarList spec={spec} />;
}
<script setup lang="ts">
import { BarList } from "@opendata-ai/openchart-vue";
import type { BarListSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 8 rows, as in the Spec tab; Copy includes them */];

const spec: BarListSpec = {
  data,
  "type": "barlist",
  "encoding": {
    "label": {
      "field": "language",
      "type": "nominal"
    },
    "value": {
      "field": "pct",
      "type": "quantitative",
      "format": ".1f"
    },
    "color": {
      "field": "category",
      "type": "nominal"
    }
  },
  "barHeight": 8,
  "watermark": false,
  "chrome": {
    "title": "Top languages",
    "subtitle": "Language popularity index, % share"
  }
};
</script>

<template>
  <BarList :spec="spec" />
</template>
<script lang="ts">
import { BarList } from "@opendata-ai/openchart-svelte";
import type { BarListSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 8 rows, as in the Spec tab; Copy includes them */];

const spec: BarListSpec = {
  data,
  "type": "barlist",
  "encoding": {
    "label": {
      "field": "language",
      "type": "nominal"
    },
    "value": {
      "field": "pct",
      "type": "quantitative",
      "format": ".1f"
    },
    "color": {
      "field": "category",
      "type": "nominal"
    }
  },
  "barHeight": 8,
  "watermark": false,
  "chrome": {
    "title": "Top languages",
    "subtitle": "Language popularity index, % share"
  }
};
</script>

<BarList {spec} />
import { createBarList } from "@opendata-ai/openchart-vanilla";
import type { BarListSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 8 rows, as in the Spec tab; Copy includes them */];

const spec: BarListSpec = {
  data,
  "type": "barlist",
  "encoding": {
    "label": {
      "field": "language",
      "type": "nominal"
    },
    "value": {
      "field": "pct",
      "type": "quantitative",
      "format": ".1f"
    },
    "color": {
      "field": "category",
      "type": "nominal"
    }
  },
  "barHeight": 8,
  "watermark": false,
  "chrome": {
    "title": "Top languages",
    "subtitle": "Language popularity index, % share"
  }
};

const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createBarList(container, spec);

A condensed table

density: "condensed" takes a table to 40px rows, and a short row count keeps it from growing a second scrollbar inside a card. Tables resolve the watermark on their own, so set watermark: false explicitly. Delta and sparkline columns fit more into each row.

A condensed table in a tile. This chart is drawn in the browser.

A condensed table in a tile. Source: Illustrative data.
{
  "type": "table",
  "data": [
    {
      "ticker": "AAPL",
      "name": "Apple",
      "sector": "Technology",
      "price": 189.84,
      "ytdChange": 48.2,
      "trend": [
        142,
        155,
        165,
        170,
        178,
        185,
        190,
        189
      ],
      "flows": [
        3,
        6,
        -2,
        8
      ]
    },
    {
      "ticker": "MSFT",
      "name": "Microsoft",
      "sector": "Technology",
      "price": 378.91,
      "ytdChange": 57.8,
      "trend": [
        240,
        275,
        295,
        310,
        330,
        345,
        365,
        379
      ],
      "flows": [
        12,
        9,
        5,
        14
      ]
    },
    {
      "ticker": "GOOGL",
      "name": "Alphabet",
      "sector": "Communication",
      "price": 141.8,
      "ytdChange": 58.3,
      "trend": [
        89,
        95,
        108,
        120,
        125,
        130,
        138,
        142
      ],
      "flows": [
        7,
        4,
        9,
        11
      ]
    },
    {
      "ticker": "AMZN",
      "name": "Amazon",
      "sector": "Consumer",
      "price": 153.42,
      "ytdChange": 82.6,
      "trend": [
        84,
        98,
        105,
        112,
        128,
        135,
        145,
        153
      ],
      "flows": [
        10,
        8,
        13,
        20
      ]
    },
    {
      "ticker": "NVDA",
      "name": "NVIDIA",
      "sector": "Technology",
      "price": 495.22,
      "ytdChange": 239,
      "trend": [
        146,
        230,
        280,
        320,
        390,
        420,
        470,
        495
      ],
      "flows": [
        40,
        55,
        62,
        88
      ]
    }
  ],
  "columns": [
    {
      "key": "ticker",
      "label": "Ticker"
    },
    {
      "key": "price",
      "label": "Price",
      "format": "$,.2f"
    },
    {
      "key": "ytdChange",
      "label": "YTD",
      "format": ".1f",
      "delta": true
    },
    {
      "key": "trend",
      "label": "8-week trend",
      "sparkline": {
        "type": "line",
        "domain": "row"
      }
    }
  ],
  "density": "condensed",
  "watermark": false,
  "chrome": {
    "title": "Watchlist"
  }
}
import { DataTable } from "@opendata-ai/openchart-react";
import type { TableSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: TableSpec = {
  "type": "table",
  "data": [/* 5 rows, as in the Spec tab; Copy includes them */],
  "columns": [
    {
      "key": "ticker",
      "label": "Ticker"
    },
    {
      "key": "price",
      "label": "Price",
      "format": "$,.2f"
    },
    {
      "key": "ytdChange",
      "label": "YTD",
      "format": ".1f",
      "delta": true
    },
    {
      "key": "trend",
      "label": "8-week trend",
      "sparkline": {
        "type": "line",
        "domain": "row"
      }
    }
  ],
  "density": "condensed",
  "watermark": false,
  "chrome": {
    "title": "Watchlist"
  }
};

export function Example() {
  return <DataTable spec={spec} />;
}
<script setup lang="ts">
import { DataTable } from "@opendata-ai/openchart-vue";
import type { TableSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: TableSpec = {
  "type": "table",
  "data": [/* 5 rows, as in the Spec tab; Copy includes them */],
  "columns": [
    {
      "key": "ticker",
      "label": "Ticker"
    },
    {
      "key": "price",
      "label": "Price",
      "format": "$,.2f"
    },
    {
      "key": "ytdChange",
      "label": "YTD",
      "format": ".1f",
      "delta": true
    },
    {
      "key": "trend",
      "label": "8-week trend",
      "sparkline": {
        "type": "line",
        "domain": "row"
      }
    }
  ],
  "density": "condensed",
  "watermark": false,
  "chrome": {
    "title": "Watchlist"
  }
};
</script>

<template>
  <DataTable :spec="spec" />
</template>
<script lang="ts">
import { DataTable } from "@opendata-ai/openchart-svelte";
import type { TableSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: TableSpec = {
  "type": "table",
  "data": [/* 5 rows, as in the Spec tab; Copy includes them */],
  "columns": [
    {
      "key": "ticker",
      "label": "Ticker"
    },
    {
      "key": "price",
      "label": "Price",
      "format": "$,.2f"
    },
    {
      "key": "ytdChange",
      "label": "YTD",
      "format": ".1f",
      "delta": true
    },
    {
      "key": "trend",
      "label": "8-week trend",
      "sparkline": {
        "type": "line",
        "domain": "row"
      }
    }
  ],
  "density": "condensed",
  "watermark": false,
  "chrome": {
    "title": "Watchlist"
  }
};
</script>

<DataTable {spec} />
import { createTable } from "@opendata-ai/openchart-vanilla";
import type { TableSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const spec: TableSpec = {
  "type": "table",
  "data": [/* 5 rows, as in the Spec tab; Copy includes them */],
  "columns": [
    {
      "key": "ticker",
      "label": "Ticker"
    },
    {
      "key": "price",
      "label": "Price",
      "format": "$,.2f"
    },
    {
      "key": "ytdChange",
      "label": "YTD",
      "format": ".1f",
      "delta": true
    },
    {
      "key": "trend",
      "label": "8-week trend",
      "sparkline": {
        "type": "line",
        "domain": "row"
      }
    }
  ],
  "density": "condensed",
  "watermark": false,
  "chrome": {
    "title": "Watchlist"
  }
};

const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createTable(container, spec);

Fields that matter

Field What it does
display: "sparkline" Strips chrome, axes, legend and watermark for a tiny trend.
mark.stroke Sets the line or area color explicitly.
watermark false hides the brand band on tiles that would otherwise show it.
chrome.title A one-line label is often enough for a supporting tile.
metrics A row of label, value and optional delta cells above the plot.
barHeight, maxItems Bar thickness in pixels and row limit on a bar list.
density "condensed" gives a table 40px rows.
encoding.*.axis An explicit axis keeps an axis that a small container would drop.