Category comparison — columns or ranked rows, grouped, stacked or 100% stacked, with highlight, value labels and a zero line for negatives. Bar list is the plain-DOM ranked list for top pages, sources and referrers.
May – Oct. Sign-ups: low 1,196 (Jul), high 1,865 (Oct), average 1,500.
| Month | Sign-ups |
|---|---|
| May | 1,284 |
| Jun | 1,412 |
| Jul | 1,196 |
| Aug | 1,538 |
| Sep | 1,702 |
| Oct | 1,865 |
Installation
The whole kit as one package — get updates by bumping the version. Add the styles to globals.css: @import "@vamos-ui/react/styles.css";
Usage
import { BarChart, BarList } from "@vamos-ui/react/charts";
<BarChart title="Won by rep" data={reps} x="rep" layout="horizontal" config={{ won: { label: "Won", format: "currency" } }} />
<BarList aria-label="Top sources" data={sources} showShare />More than 20 categories in columns logs a development hint — switch to horizontal or group into Other.
Examples
Grouped
Two series side by side; the target uses the neutral fg-subtle token.
Q1 – Q4. Target: low $420,000.00 (Q1), high $560,000.00 (Q4), average $485,000.00. Actual: low $386,500.00 (Q1), high $512,800.00 (Q3), average $467,200.00.
| Quarter | Target | Actual |
|---|---|---|
| Q1 | $420,000.00 | $386,500.00 |
| Q2 | $460,000.00 | $471,200.00 |
| Q3 | $500,000.00 | $512,800.00 |
| Q4 | $560,000.00 | $498,300.00 |
Stacked
Only the outer segment is rounded; the tooltip reads the total.
Mon – Sun. Chat: low 35 (Sun), high 116 (Thu), average 81.86. Email: low 18 (Sun), high 77 (Thu), average 54.14. Phone: low 4 (Sun), high 31 (Thu), average 18.71.
| Day | Chat | Phone | |
|---|---|---|---|
| Mon | 92 | 64 | 21 |
| Tue | 104 | 71 | 26 |
| Wed | 88 | 58 | 19 |
| Thu | 116 | 77 | 31 |
| Fri | 97 | 69 | 24 |
| Sat | 41 | 22 | 6 |
| Sun | 35 | 18 | 4 |
Ranking (CRM)
layout="horizontal" grows rows from inline-start; valueLabels print each value.
Maya Chen – Sam Okafor. Closed won: low $61,300.00 (Sam Okafor), high $184,000.00 (Maya Chen), average $119,216.67.
| Rep | Closed won |
|---|---|
| Maya Chen | $184,000.00 |
| Diego Alvarez | $152,500.00 |
| Priya Raman | $131,200.00 |
| Tom Becker | $98,400.00 |
| Aylin Kaya | $87,900.00 |
| Sam Okafor | $61,300.00 |
Profit and loss
Negative values get a prominent zero line.
May – Oct. Net income: low -$12,400.00 (Jul), high $42,300.00 (May), average $17,783.33.
| Month | Net income |
|---|---|
| May | $42,300.00 |
| Jun | $18,900.00 |
| Jul | -$12,400.00 |
| Aug | -$4,800.00 |
| Sep | $27,600.00 |
| Oct | $35,100.00 |
Highlight (CMS)
highlight(row) keeps full colour; the rest dim to 35%.
May – Nov. Posts published: low 19 (Nov), high 52 (Oct), average 37.
| Month | Posts published |
|---|---|
| May | 34 |
| Jun | 41 |
| Jul | 29 |
| Aug | 38 |
| Sep | 47 |
| Oct | 52 |
| Nov | 19 |
Bar list
An <ol> with full text per row; max groups the tail into "Other (n)"; delta shows the change.
Top sources
Track variant
API
BarChart
| Prop | Type | Default |
|---|---|---|
…Chart propsSee Chart frame. | ChartProps | — |
seriesKeys to draw. Default: every config key. | string[] | — |
layoutColumns, or rows (rankings, long labels). | "vertical" | "horizontal" | "vertical" |
stackStacking. | "none" | "stacked" | "percent" | "none" |
radiusCorner radius; stacked bars round the outer segment only. | number | 4 |
highlightRows to keep in full colour; others dim. | (row) => boolean | — |
valueLabelsFormatted values on the bars. | boolean | false |
barSizeFixed bar thickness. | "auto" | number | "auto" |
referenceReference lines on the value axis. | { y, label?, color? }[] | — |
BarList
| Prop | Type | Default |
|---|---|---|
dataRows. delta is a ratio (0.12 → +12%). | { key, label, value, textLabel?, href?, icon?, delta? }[] | — |
formatValue format. | FormatSpec | "number" |
colorBar colour token. | ChartColor | accent-soft |
maxTop N; the rest merge into "Other (n)". | number | — |
sortTies are sorted with the locale collator. | "desc" | "asc" | "none" | "desc" |
showShareEach row's share of the total. | boolean | false |
onItemClickRows become buttons. Rows with href are links. | (item) => void | — |
variantBar behind the label, or a thin bar under it. | "filled" | "track" | "filled" |
sizeRow height 28 / 32 px. | "sm" | "md" | "md" |
loading / emptyMessageDescending skeleton rows; text when data is empty. | boolean / ReactNode | — |