Diverging bars
Use it for change between two periods, such as the themes trending up and down this week compared with last. Rises go right and falls go left from a shared zero line, and the arrow in the label means the direction never depends on colour alone. It is plain HTML, so labels wrap and select.
How to use it
Paste the toolkit from Get the code into your page first, then call the chart like this.
container.append(
divergingBars([
{ label: 'Certificates', value: 9, sub: 'from 6 to 15 conversations' },
{ label: 'Renewals', value: 4, sub: 'from 21 to 25' },
{ label: 'Complaints', value: -7, sub: 'from 11 to 4' }
], {
leftLabel: 'Fewer than last week',
rightLabel: 'More than last week',
fmt: v => (v > 0 ? '+' : '−') + Math.abs(v),
empty: 'Nothing changed this week'
})
);Options
What you can pass to this chart.
items
[{ label, value, sub?, tag?, onClick? }]. Positive values go right, negative left; bars scale to the largest change.
fmt
Value formatter (default signed, one decimal).
leftLabel, rightLabel
Headings over the two sides (default Down and Up).
upColour, downColour
Bar colours (default orange for up, blue for down: separable for colour-blind readers).
sort
False keeps your order; the default sorts from the biggest rise to the biggest fall.
empty
Text for the empty state.
More charts like this
Other charts in the “Comparing” group.
Slope chart
Two moments side by side, one line per item, so rises and falls read at a glance.
View chart →Bump chart
Rank over time: who is first this week, and how each one got there.
View chart →Grouped bars
Compare two measures side by side per period, with a derived line on top.
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.