Bump chart
How the ranks of a few things changed, as lines that cross where one overtakes another.
On this page
A bump chart follows ranks, not values. At each label the series are ranked by their values, and each series is a line through its ranks, so who led, who overtook whom and when is read at a glance. The ranks are written beside the plot and each series' name at its last rank.
Bump chart
<div class="card max-w(560) mx-auto"> <div class="card-header"> <h3 class="card-title">Projects</h3> <p class="card-description">Rank by stars, each quarter</p> </div> <figure class="chart" id="ranking"></figure></div><script>addEventListener('DOMContentLoaded', function () {MasterUI.chart(document.getElementById('ranking'), { type: 'bump', label: 'Rank of four projects by stars, each quarter', labels: ['Q1', 'Q2', 'Q3', 'Q4', 'Q1', 'Q2'], series: [ { name: 'Atlas', values: [90, 120, 180, 260, 300, 340] }, { name: 'Beacon', values: [140, 150, 160, 170, 280, 420] }, { name: 'Cairn', values: [60, 160, 170, 180, 190, 200] }, { name: 'Delta', values: [120, 130, 140, 150, 160, 170] } ]})})</script><script type="module"> import { attach } from '@master/ui/behaviors' attach()</script>import { Chart } from './ui/chart'<div className="card max-w(560) mx-auto"> <div className="card-header"> <h3 className="card-title">Projects</h3> <p className="card-description">Rank by stars, each quarter</p> </div> <Chart id="ranking" type="bump" label="Rank of four projects by stars, each quarter" labels={['Q1', 'Q2', 'Q3', 'Q4', 'Q1', 'Q2']} series={[ { name: 'Atlas', values: [90, 120, 180, 260, 300, 340] }, { name: 'Beacon', values: [140, 150, 160, 170, 280, 420] }, { name: 'Cairn', values: [60, 160, 170, 180, 190, 200] }, { name: 'Delta', values: [120, 130, 140, 150, 160, 170] } ]} /></div><script> import Chart from './ui/Chart.svelte'</script><div class="card max-w(560) mx-auto"> <div class="card-header"> <h3 class="card-title">Projects</h3> <p class="card-description">Rank by stars, each quarter</p> </div> <Chart id="ranking" type="bump" label="Rank of four projects by stars, each quarter" labels={['Q1', 'Q2', 'Q3', 'Q4', 'Q1', 'Q2']} series={[ { name: 'Atlas', values: [90, 120, 180, 260, 300, 340] }, { name: 'Beacon', values: [140, 150, 160, 170, 280, 420] }, { name: 'Cairn', values: [60, 160, 170, 180, 190, 200] }, { name: 'Delta', values: [120, 130, 140, 150, 160, 170] } ]} /></div><script setup>import Chart from './ui/Chart.vue'</script><template> <div class="card max-w(560) mx-auto"> <div class="card-header"> <h3 class="card-title">Projects</h3> <p class="card-description">Rank by stars, each quarter</p> </div> <Chart id="ranking" type="bump" label="Rank of four projects by stars, each quarter" :labels="['Q1', 'Q2', 'Q3', 'Q4', 'Q1', 'Q2']" :series="[ { name: 'Atlas', values: [90, 120, 180, 260, 300, 340] }, { name: 'Beacon', values: [140, 150, 160, 170, 280, 420] }, { name: 'Cairn', values: [60, 160, 170, 180, 190, 200] }, { name: 'Delta', values: [120, 130, 140, 150, 160, 170] } ]" /> </div></template>Give the values and the chart ranks them: the highest is first, or the lowest with ascending: true, for times and prices. From rank to rank a line leaves and arrives level, so a change of rank is one clear turn. A bump chart hides how far apart the values are; where the distance matters, draw a line chart of the values themselves.
#Options
| Option | Default | |
|---|---|---|
label | none | What the chart shows and in what unit: the plot's accessible name |
labels | [] | The names along the scale, around a radar or over a heatmap's columns |
series | [] | Each with a name and what its form reads: values, a value, points, ranges or children; optionally a category, a type, low and high, and a ring's max |
ascending | false | In a bump chart, the lowest value ranks first |
format, tickFormat | the locale's | How a value and a tick are written; xFormat for a scatter's scale across |
current | none | The index of the point marked aria-current |
The readout, the keys, the legend, the colors and the scale are the same in every form: Chart holds them, with every option, class and custom property.