Slope chart
Use it to compare the same items at two points: this week against last, or the first month against the latest. The slope of each line is the change, steep for big movers and flat for steady ones, and labels at both ends carry the numbers. Use it for a handful of items rather than dozens.
How to use it
Paste the toolkit from Get the code into your page first, then call the chart like this.
const chart = slope({
items: [
{ label: 'Certificates', from: 6, to: 15 },
{ label: 'Renewals', from: 21, to: 25 },
{ label: 'Complaints', from: 11, to: 4 }
],
fromLabel: 'Week before',
toLabel: 'Last week',
fmt: v => Math.round(v),
label: 'Conversations by theme, week on week'
});
document.querySelector('#host').append(chart);Options
What you can pass to this chart.
items
[{ label, from, to, colour? }]. Colour follows direction unless you set one.
fromLabel, toLabel
Headings over the two axes.
fmt
Value formatter for the labels and tooltip.
upColour, downColour
Line colours for a rise and a fall (default orange and blue).
height
Chart height; by default it grows with the number of items.
label / empty
aria-label for screen readers; text shown when there is nothing to compare.
More charts like this
Other charts in the “Comparing” group.
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 →Ranked bars
A top-N list with a bar per row, a detail line and optional click-through.
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.