Skip to content

Bar Chart ^0.1.17 ​

Versatile bar / column chart. Supports single series, grouped, stacked, percent-stacked, horizontal orientation, negative values, references, value labels, and custom colors.

Basic ​

015.7531.547.2563JanFebMarAprMayJunJulAugSepOctNovDec
vue
<VxBarChart :data="[12, 19, 14, 24, 30, 22, 35, 40, 38, 52, 48, 60]" :labels="months" />

Grouped ​

Compare multiple series side-by-side.

073.5147220.5294JanFebMarAprMayJunJulAugSepOctNovDec
Revenue
Cost
vue
<VxBarChart :data="series" :labels="months" legend />

Stacked ​

036.7573.5110.25147JanFebMarAprMayJun
Organic
Paid
Social
Referral
vue
<VxBarChart :data="series" :labels="labels" stacked legend />

Percent stacked ​

Normalize each category to 100% — great for composition analysis.

0%26%53%79%105%JanFebMarAprMayJun
Organic
Paid
Social
Referral
vue
<VxBarChart :data="series" :labels="labels" percentStacked legend />

Horizontal ​

Swap the axes — useful for long category labels.

0367.57351.1k1.5k3301.4k125831.4k676559USAChinaJapanGermanyIndiaUKFranceItaly
vue
<VxBarChart
  :data="[330, 1400, 125, 83, 1380, 67, 65, 59]"
  :labels="['USA','China','Japan','Germany','India','UK','France','Italy']"
  orientation="horizontal"
  color="#22c55e"
  valueLabels
/>

Horizontal grouped ​

051.19102.38153.56204.75Q1Q2Q3Q4
2023
2024
2025
vue
<VxBarChart :data="series" :labels="quarters" orientation="horizontal" legend />

Negative values ​

Negative bars extend below zero automatically.

-15.64.22443.863.61824-832-12284238-6524860JanFebMarAprMayJunJulAugSepOctNovDec
vue
<VxBarChart :data="[18, 24, -8, 32, -12, 28, 42, 38, -6, 52, 48, 60]" :labels="months" valueLabels />

Reference lines ​

015.7531.547.2563TargetMinimumJanFebMarAprMayJunJulAugSepOctNovDec
vue
<VxBarChart
  :data="data"
  :labels="labels"
  :references="[
    { value: 50, label: 'Target',  color: '#22c55e' },
    { value: 20, label: 'Minimum', color: '#ef4444' },
  ]"
/>

Value labels ​

015.7531.547.2563121914243022354038524860JanFebMarAprMayJunJulAugSepOctNovDec
vue
<VxBarChart :data="data" :labels="months" valueLabels />

Custom colors ​

Pass a colors array to override the palette for multi-series charts.

036.7573.5110.25147JanFebMarAprMayJun
Organic
Paid
Social
Referral
vue
<VxBarChart
  :data="series"
  :labels="labels"
  stacked
  legend
  :colors="['#6366f1', '#22c55e', '#f59e0b', '#ef4444']"
/>

Live updating ​

Values are smoothly tweened when the data changes.

011.5523.134.6546.22028243430403644ABCDEFGH
vue
<VxBarChart :data="liveData" :labels="labels" valueLabels />

Interactive playground ​

015.7531.547.2563121914243022354038524860JanFebMarAprMayJunJulAugSepOctNovDec

Dashboard card ​

Monthly revenue

Last 12 months · growing 34% YoY

073.5147220.5294JanFebMarAprMayJunJulAugSepOctNovDec
Revenue
Cost

Props ​

PropTypeDefaultDescription
datanumber[] | BarChartSeries[][]Single array or multi-series
labels(string | number)[][]Category labels
orientation'vertical' | 'horizontal''vertical'Bar direction
stackedbooleanfalseStack multi-series vertically
percentStackedbooleanfalseNormalize stacks to 100%
heightnumber280SVG height in px
barGapnumber0.3Gap between groups (0–1)
groupGapnumber0.15Gap inside a group (0–1)
radiusnumber4Corner radius
colorstring—Single-series fill color
colorsstring[][]Multi-series palette
referencesBarChartReference[][]Horizontal guide lines
valueLabelsbooleanfalseShow numeric label at bar end
legendbooleanfalseShow legend (multi-series)
tooltipbooleantrueShow tooltip on hover
gridbooleantrueShow grid lines
axisbooleantrueShow axis labels
animatebooleantrueTween value changes
animationDurationnumber700Tween length in ms
min / maxnumber—Force value-axis bounds
formatValue(v: number) => stringsmartFormat axis / tooltip values

Events ​

EventPayload
hover{ seriesIndex, categoryIndex, value }
click{ seriesIndex, categoryIndex, value }