Data Visualisation

Line chart

<DomLineChart>

Compare trends, reporting periods, and targets with proportional time or ordered category axes.

Revenue and a target

Revenue against target

April–September 2026 · GBP

View data for Revenue against target
Revenue against target. Missing measurements are shown as a dash.
monthRevenueMonthly target
Apr£18,200£22,000
May£22,400£22,000
Jun£19,800£22,000
Jul£26,800£22,000
Aug£24,300£22,000
Sep£31,200£22,000
Install
npm install @getdom/studio
vue
<script setup>
import '@getdom/studio/style.css';
import { ref } from 'vue';
import { DomLineChart } from '@getdom/studio';
const rows = [
	{ month: 'Apr', revenue: 18200, target: 22000, subscriptions: 12400, services: 5800 },
	{ month: 'May', revenue: 22400, target: 22000, subscriptions: 14600, services: 7800 },
	{ month: 'Jun', revenue: 19800, target: 22000, subscriptions: 13800, services: 6000 },
	{ month: 'Jul', revenue: 26800, target: 22000, subscriptions: 18400, services: 8400 },
	{ month: 'Aug', revenue: 24300, target: 22000, subscriptions: 17500, services: 6800 },
	{ month: 'Sep', revenue: 31200, target: 22000, subscriptions: 21600, services: 9600 },
];
const selected = ref(null);
const series = [{ key: 'revenue', label: 'Revenue', color: 'chart-1' }, { key: 'target', label: 'Monthly target', color: 'muted-fg', dashed: true }];
</script>
<template>
	<div class="w-full">
		<DomLineChart title="Revenue against target" description="April–September 2026 · GBP" :rows="rows" x-key="month" :series="series" format="currency" @select="selected = $event.row" />
		<p v-if="selected" class="mt-3 text-xs text-muted-fg">Selected reporting month: {{ selected.month }}</p>
	</div>
</template>

Loading, errors, missing data, and zero

Daily signups

Zero signups on Tuesday; Wednesday has no measurement.

View data for Daily signups
Daily signups. Missing measurements are shown as a dash.
daySignups
Mon12
Tue0
Wed
Thu18
Fri9
Install
npm install @getdom/studio
vue
<script setup>
import '@getdom/studio/style.css';
import { ref, computed } from 'vue';
import { DomLineChart, DomNativeSelect } from '@getdom/studio';
const state = ref('ready');
const options = [{ value: 'ready', label: 'Missing readings and zero' }, { value: 'loading', label: 'Loading' }, { value: 'empty', label: 'Empty' }, { value: 'error', label: 'Error' }, { value: 'single', label: 'Single point' }];
const measurements = [{ day: 'Mon', count: 12 }, { day: 'Tue', count: 0 }, { day: 'Wed', count: null }, { day: 'Thu', count: 18 }, { day: 'Fri', count: 9 }];
/** Selects a data shape without modifying the original records. */
const rows = computed(() => state.value === 'empty' ? [] : state.value === 'single' ? measurements.slice(0, 1) : measurements);
</script>
<template>
	<div class="w-full space-y-5">
		<DomNativeSelect v-model="state" label="Example state" :options="options" class="max-w-xs" />
		<DomLineChart title="Daily signups" description="Zero signups on Tuesday; Wednesday has no measurement." :rows="rows" x-key="day" :series="[{ key: 'count', label: 'Signups', color: 'chart-2' }]" :loading="state === 'loading'" :error="state === 'error' ? 'The reporting service is unavailable.' : ''" @retry="state = 'ready'" />
	</div>
</template>

Working with your data

Records stay in your application. Select events return the original row and index. Use stable series keys and explicit colours when coordinating several charts.

Explore Data Visualisation

Reference

Props

Control props

NameTypeTSDefaultDescription
rowsarrayArray<unknown>[]Application-owned records. Missing measurements remain gaps; zero is valid.
seriesarrayArray<unknown>[]Field keys or { key, label, color, dashed } definitions. Keep keys stable when filtering.
xKeystringstring'date'Record field used for category or horizontal axis values.
xType'category' | 'time' | 'number'string'category'Category preserves row order; time and number use proportional, sorted coordinates.
titlestringstring'Chart'Visible title and accessible chart name.
descriptionstringstring''Supporting context, units, or reporting period.
heightnumbernumber280Plot height in pixels; width responds to its container.
format'number' | 'compact' | 'currency' | 'percent'string'number'Value format. Percent expects fractions, such as 0.25 for 25%.
currencystringstring'GBP'ISO currency code for currency formatting.
localestringstring'en-GB'Locale used for number and date labels.
valueFormatterfunctionFunctionOptional (value) => string override shared by axes, tooltips, and tables.
xFormatterfunctionFunctionOptional (value) => string override for category/date labels.
yFormatterfunctionFunctionOptional (value) => string for value-axis ticks only. Tooltips and tables keep the full valueFormatter output.
loadingbooleanbooleanfalseShow a loading state in the reserved plot space.
errorstringstring''Show an application-owned error with a retry action.
emptyLabelstringstring'No data for this period'Message when no finite measurements are available.
legendbooleanbooleantrueShow buttons to toggle series without changing their colours.
showTablebooleanbooleantrueOffer an accessible, server-rendered table of the chart data.
gridbooleanbooleantrueShow subtle value-axis grid lines.
curve'linear' | 'monotoneX' | 'step'string'linear'Line interpolation. Linear avoids implying unobserved smooth changes.

Auto-generated from Line chart.props and inline _edit hints.

Events

NamePayloadDescription
@select{ row, index }Original application record selected by click or Enter.
@retryRequests another attempt to load application data.

Names auto-detected from defineEmits and source emit() calls; payload and description from __doc.events when present.

Keyboard

  • Arrow keys / Home / EndInspect data points.
  • EnterSelect the inspected record.