Data Visualisation

Bar chart

<DomBarChart>

Compare categories with vertical or horizontal bars, grouped series, and percentage stacks.

Grouped, stacked, percentage, and horizontal bars

Horizontal bars
Revenue by plan

New and returning accounts · September 2026

View data for Revenue by plan
Revenue by plan. Missing measurements are shown as a dash.
planNew accountsReturning accounts
Starter£4,800£2,200
Growth£7,400£9,800
Scale£6,200£15,400
Enterprise£12,500£18,200
Install
npm install @getdom/studio
vue
<script setup>
import '@getdom/studio/style.css';
import { ref } from 'vue';
import { DomBarChart, DomNativeSelect, DomToggle } from '@getdom/studio';
const layout = ref('grouped');
const horizontal = ref(false);
const rows = [{ plan: 'Starter', new: 4800, returning: 2200 }, { plan: 'Growth', new: 7400, returning: 9800 }, { plan: 'Scale', new: 6200, returning: 15400 }, { plan: 'Enterprise', new: 12500, returning: 18200 }];
const series = [{ key: 'new', label: 'New accounts', color: 'chart-1' }, { key: 'returning', label: 'Returning accounts', color: 'chart-2' }];
</script>
<template>
	<div class="w-full space-y-5">
		<div class="flex flex-wrap items-end gap-5"><DomNativeSelect v-model="layout" label="Bar layout" :options="[{ value: 'grouped', label: 'Grouped' }, { value: 'stacked', label: 'Stacked' }, { value: 'percentage', label: 'Percentage' }]" /><DomToggle v-model="horizontal" label="Horizontal bars" /></div>
		<DomBarChart title="Revenue by plan" description="New and returning accounts · September 2026" :rows="rows" x-key="plan" :series="series" :horizontal="horizontal" :stacked="layout === 'stacked'" :percentage="layout === 'percentage'" format="currency" />
	</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.
stackedbooleanbooleanfalseStack series within each category.
percentagebooleanbooleanfalseNormalize non-negative visible series to a 100% stack.
horizontalbooleanbooleanfalsePlace category labels down the left side.

Auto-generated from Bar 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.