Ranked horizontal bars
Use it for rankings with long labels (merchants, products, people) where columns would force tiny rotated text. It is plain HTML, so it wraps, selects and reads naturally.
How to use it
Paste the toolkit from Get the code into your page first, then call the chart like this.
container.append(
hbars([
{ label: 'Greenleaf Market', value: 612, sub: '14 payments, average £44',
colour: catColor('Groceries'), onClick: () => openMerchant('Greenleaf Market') },
{ label: 'Northline Rail', value: 388, sub: '9 payments', tag: '▲ 12%',
colour: catColor('Transport') }
], { fmt: v => '£' + Math.round(v), empty: 'No merchants yet' })
);Options
What you can pass to this chart.
items
[{ label, value, sub?, tag?, colour?, onClick? }]. Sorted by you; bars scale to the largest.
fmt
Value formatter (default money0).
empty
Text for the empty state.
More charts like this
Other charts in the “Comparing” group.
Waterfall
How a starting number becomes an ending number, step by step.
View chart →Diverging bars
What went up and what went down: bars either side of a zero line, biggest rise at the top.
View chart →Slope chart
Two moments side by side, one line per item, so rises and falls read at a glance.
View chart →Want charts or dashboards like these in your own product?
Tell me what you are trying to see and I can help work out the right approach, from the data behind it to the screen in front of people.