Skip to content
OpenChart

When to use a bar chart race

A bar chart race shows the order in which entries overtook each other. Census data shows what it hides, and when a bump chart or line chart works better.

1. California, 39.5M. 2. Texas, 29.1M. 3. Florida, 21.5M. 4. New York, 20.2M. 5. Pennsylvania, 13M. 6. Illinois, 12.8M. 7. Ohio, 11.8M. 8. Georgia, 10.7M. 9. North Carolina, 10.4M. 10. Michigan, 10.1M.California became the most populous state in 1970Resident population at each census, the 10 most populous states, 1910-202005M10M15M20M25M30M35M2020California39.5MTexas29.1MFlorida21.5MNew York20.2MPennsylvania13MIllinois12.8MOhio11.8MGeorgia10.7MNorth Carolina10.4MMichigan10.1M20201. California, 39.5M. 2. Texas, 29.1M. 3. Florida, 21.5M. 4. New York, 20.2M. 5. Pennsylvania, 13M. 6. Illinois, 12.8M. 7. Ohio, 11.8M. 8. Georgia, 10.7M. 9. North Carolina, 10.4M. 10. Michigan, 10.1M.California became the most populous state in 1970Resident population at each census, the 10 most populous states, 1910-202005M10M15M20M25M30M35M2020California39.5MTexas29.1MFlorida21.5MNew York20.2MPennsylvania13MIllinois12.8MOhio11.8MGeorgia10.7MNorth Carolina10.4MMichigan10.1M2020
The 10 most populous states at each census, 1910-2020. Source: US Census Bureau, decennial census resident population by state.

Made with OpenChart. How to build this race chart

Use a bar chart race when the story is the order in which things overtook each other, and when readers will watch it play. New York was the most populous state at every census from 1910 to 1960. California passed it in 1970, Texas in 2000 and Florida in 2020, and a race plays those overtakes in the order they happened. It is a poor choice for comparing two dates, judging growth or letting a reader scan, because each frame replaces the one before it.

What a race shows well

The race at the top of this post ranks the 10 most populous states at each census from 1910 to 2020, using the Census Bureau’s resident population counts. The order of the top 10 changes at every one of the 11 steps between the 12 censuses, and the race plays them in 8.4 seconds, 700 milliseconds per census. Pennsylvania slides from 2nd to 6th by 2000, Florida enters in 1960 in 10th place, and Georgia drops out in 1920 and returns in 2000.

A ranking that barely changes makes a dull race. If the leader holds first for the whole run and two entries swap once, the reader watches bars grow in place for 20 seconds to see one swap, and a line chart shows that swap at a glance. Count the changes of order in your data before you choose.

What a race hides

Two moments never share the screen. California grew more than 16-fold, from 2.4 million people in 1910 to 39.5 million in 2020, while New York grew from 9.1 million to 20.2 million. The race shows all four numbers, but a reader who wants to compare them has to remember bars that left the screen seconds earlier.

Bar lengths don’t compare across frames either. By default each frame fits its scale to the bars on screen, so the leading state’s bar is about the same length whether it holds 9.1 million people or 39.5 million. Setting race.rescale: "fixed" keeps one scale for the whole run, at the cost of a 1910 chart where every bar is under a quarter of the width.

Anything below the top 10 is invisible. Florida ranked 33rd in 1910, and its population grew 3.7-fold by 1950, but it doesn’t appear until 1960.

A reader who scrolls past a race sees one frame, and a reader who prefers reduced motion gets the race paused on its last frame and steps through it one census at a time. Put the finding in the title so that one frame carries it.

A bump chart shows every rank at once

A bump chart plots rank instead of value, one line per state across all 12 censuses. Every overtake in the race is a crossing here, and all of them are on screen together.

1910193019501970199020101st5th10th20th33rdCaliforniaFloridaIllinoisNew YorkOhioPennsylvaniaTexasFlorida climbed from 33rd to 3rd and New York fell to 4thRank by population among the 50 states at each census, states that reached the top five, 1910-20201910193019501970199020101st5th10th20th33rdCaliforniaFloridaIllinoisNew YorkOhioPennsylvaniaTexasFlorida climbed from 33rd to 3rd and New York fell to 4thRank by population among the 50 states at each census, states that reached the top five, 1910-2020
Population rank of seven states, 1910-2020. Source: US Census Bureau, decennial census resident population by state.

Made with OpenChart. How to build this line chart

{
  "mark": {
    "type": "line",
    "interpolate": "monotone",
    "point": true
  },
  "data": [
    {
      "state": "California",
      "year": "1910",
      "rank": 12
    },
    {
      "state": "California",
      "year": "1920",
      "rank": 8
    },
    {
      "state": "California",
      "year": "1930",
      "rank": 6
    },
    {
      "state": "California",
      "year": "1940",
      "rank": 5
    },
    {
      "state": "California",
      "year": "1950",
      "rank": 2
    },
    {
      "state": "California",
      "year": "1960",
      "rank": 2
    },
    // … 78 more rows; Copy includes them
  ],
  "encoding": {
    "x": {
      "field": "year",
      "type": "ordinal",
      "axis": {
        "labelAngle": 0,
        "values": [
          "1910",
          "1930",
          "1950",
          "1970",
          "1990",
          "2010"
        ]
      }
    },
    "y": {
      "field": "rank",
      "type": "quantitative",
      "scale": {
        "reverse": true,
        "zero": false,
        "domain": [
          1,
          33
        ]
      },
      "axis": {
        "values": [
          1,
          5,
          10,
          20,
          33
        ],
        "format": "ordinal"
      }
    },
    "color": {
      "field": "state",
      "type": "nominal"
    }
  },
  "endpointLabels": {
    "ends": "end",
    "content": "label",
    "showMarker": false
  },
  "legend": {
    "show": false
  },
  "theme": {
    "colors": {
      "categorical": [
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        }
      ]
    }
  },
  "overrides": {
    "compact": {
      "encoding": {
        "x": {
          "axis": {
            "values": [
              "1910",
              "1960",
              "2020"
            ]
          }
        }
      }
    },
    "medium": {
      "encoding": {
        "x": {
          "axis": {
            "values": [
              "1910",
              "1960",
              "2020"
            ]
          }
        }
      }
    }
  },
  "chrome": {
    "title": "Florida climbed from 33rd to 3rd and New York fell to 4th",
    "subtitle": "Rank by population among the 50 states at each census, states that reached the top five, 1910-2020"
  }
}
import { Chart } from "@opendata-ai/openchart-react";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 84 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": {
    "type": "line",
    "interpolate": "monotone",
    "point": true
  },
  "encoding": {
    "x": {
      "field": "year",
      "type": "ordinal",
      "axis": {
        "labelAngle": 0,
        "values": [
          "1910",
          "1930",
          "1950",
          "1970",
          "1990",
          "2010"
        ]
      }
    },
    "y": {
      "field": "rank",
      "type": "quantitative",
      "scale": {
        "reverse": true,
        "zero": false,
        "domain": [
          1,
          33
        ]
      },
      "axis": {
        "values": [
          1,
          5,
          10,
          20,
          33
        ],
        "format": "ordinal"
      }
    },
    "color": {
      "field": "state",
      "type": "nominal"
    }
  },
  "endpointLabels": {
    "ends": "end",
    "content": "label",
    "showMarker": false
  },
  "legend": {
    "show": false
  },
  "theme": {
    "colors": {
      "categorical": [
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        }
      ]
    }
  },
  "overrides": {
    "compact": {
      "encoding": {
        "x": {
          "axis": {
            "values": [
              "1910",
              "1960",
              "2020"
            ]
          }
        }
      }
    },
    "medium": {
      "encoding": {
        "x": {
          "axis": {
            "values": [
              "1910",
              "1960",
              "2020"
            ]
          }
        }
      }
    }
  },
  "chrome": {
    "title": "Florida climbed from 33rd to 3rd and New York fell to 4th",
    "subtitle": "Rank by population among the 50 states at each census, states that reached the top five, 1910-2020"
  }
};

export function Example() {
  return <Chart spec={spec} />;
}
<script setup lang="ts">
import { Chart } from "@opendata-ai/openchart-vue";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 84 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": {
    "type": "line",
    "interpolate": "monotone",
    "point": true
  },
  "encoding": {
    "x": {
      "field": "year",
      "type": "ordinal",
      "axis": {
        "labelAngle": 0,
        "values": [
          "1910",
          "1930",
          "1950",
          "1970",
          "1990",
          "2010"
        ]
      }
    },
    "y": {
      "field": "rank",
      "type": "quantitative",
      "scale": {
        "reverse": true,
        "zero": false,
        "domain": [
          1,
          33
        ]
      },
      "axis": {
        "values": [
          1,
          5,
          10,
          20,
          33
        ],
        "format": "ordinal"
      }
    },
    "color": {
      "field": "state",
      "type": "nominal"
    }
  },
  "endpointLabels": {
    "ends": "end",
    "content": "label",
    "showMarker": false
  },
  "legend": {
    "show": false
  },
  "theme": {
    "colors": {
      "categorical": [
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        }
      ]
    }
  },
  "overrides": {
    "compact": {
      "encoding": {
        "x": {
          "axis": {
            "values": [
              "1910",
              "1960",
              "2020"
            ]
          }
        }
      }
    },
    "medium": {
      "encoding": {
        "x": {
          "axis": {
            "values": [
              "1910",
              "1960",
              "2020"
            ]
          }
        }
      }
    }
  },
  "chrome": {
    "title": "Florida climbed from 33rd to 3rd and New York fell to 4th",
    "subtitle": "Rank by population among the 50 states at each census, states that reached the top five, 1910-2020"
  }
};
</script>

<template>
  <Chart :spec="spec" />
</template>
<script lang="ts">
import { Chart } from "@opendata-ai/openchart-svelte";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 84 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": {
    "type": "line",
    "interpolate": "monotone",
    "point": true
  },
  "encoding": {
    "x": {
      "field": "year",
      "type": "ordinal",
      "axis": {
        "labelAngle": 0,
        "values": [
          "1910",
          "1930",
          "1950",
          "1970",
          "1990",
          "2010"
        ]
      }
    },
    "y": {
      "field": "rank",
      "type": "quantitative",
      "scale": {
        "reverse": true,
        "zero": false,
        "domain": [
          1,
          33
        ]
      },
      "axis": {
        "values": [
          1,
          5,
          10,
          20,
          33
        ],
        "format": "ordinal"
      }
    },
    "color": {
      "field": "state",
      "type": "nominal"
    }
  },
  "endpointLabels": {
    "ends": "end",
    "content": "label",
    "showMarker": false
  },
  "legend": {
    "show": false
  },
  "theme": {
    "colors": {
      "categorical": [
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        }
      ]
    }
  },
  "overrides": {
    "compact": {
      "encoding": {
        "x": {
          "axis": {
            "values": [
              "1910",
              "1960",
              "2020"
            ]
          }
        }
      }
    },
    "medium": {
      "encoding": {
        "x": {
          "axis": {
            "values": [
              "1910",
              "1960",
              "2020"
            ]
          }
        }
      }
    }
  },
  "chrome": {
    "title": "Florida climbed from 33rd to 3rd and New York fell to 4th",
    "subtitle": "Rank by population among the 50 states at each census, states that reached the top five, 1910-2020"
  }
};
</script>

<Chart {spec} />
import { createChart } from "@opendata-ai/openchart-vanilla";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 84 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": {
    "type": "line",
    "interpolate": "monotone",
    "point": true
  },
  "encoding": {
    "x": {
      "field": "year",
      "type": "ordinal",
      "axis": {
        "labelAngle": 0,
        "values": [
          "1910",
          "1930",
          "1950",
          "1970",
          "1990",
          "2010"
        ]
      }
    },
    "y": {
      "field": "rank",
      "type": "quantitative",
      "scale": {
        "reverse": true,
        "zero": false,
        "domain": [
          1,
          33
        ]
      },
      "axis": {
        "values": [
          1,
          5,
          10,
          20,
          33
        ],
        "format": "ordinal"
      }
    },
    "color": {
      "field": "state",
      "type": "nominal"
    }
  },
  "endpointLabels": {
    "ends": "end",
    "content": "label",
    "showMarker": false
  },
  "legend": {
    "show": false
  },
  "theme": {
    "colors": {
      "categorical": [
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        }
      ]
    }
  },
  "overrides": {
    "compact": {
      "encoding": {
        "x": {
          "axis": {
            "values": [
              "1910",
              "1960",
              "2020"
            ]
          }
        }
      }
    },
    "medium": {
      "encoding": {
        "x": {
          "axis": {
            "values": [
              "1910",
              "1960",
              "2020"
            ]
          }
        }
      }
    }
  },
  "chrome": {
    "title": "Florida climbed from 33rd to 3rd and New York fell to 4th",
    "subtitle": "Rank by population among the 50 states at each census, states that reached the top five, 1910-2020"
  }
};

const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createChart(container, spec);

Florida’s climb from 33rd and New York’s slide after 1960 read in one look. Ranks drop the sizes, so first and second place sit one rank apart both in 1910, when New York had 1.4 million more people than Pennsylvania, and in 2020, when California had 10.4 million more than Texas. Every extra line adds crossings, so this chart keeps only the seven states that ever ranked in the top five.

A line chart keeps the values

A line chart of the same seven states shows how fast each state grew, which the ranks leave out.

192019401960198020002020010M20M30M40MResidentsCaliforniaFloridaIllinoisNew YorkOhioPennsylvaniaTexasTexas passed New York in 2000 and Florida passed it in 2020Resident population at each census, states that reached the top five, 1910-2020192019401960198020002020010M20M30M40MResidentsCaliforniaFloridaIllinoisNew YorkOhioPennsylvaniaTexasTexas passed New York in 2000 and Florida passed it in 2020Resident population at each census, states that reached the top five, 1910-2020
Live example. Source: US Census Bureau, decennial census resident population by state.

Made with OpenChart. How to build this line chart

{
  "mark": "line",
  "encoding": {
    "x": {
      "field": "year",
      "type": "temporal",
      "axis": {
        "format": "%Y"
      }
    },
    "y": {
      "field": "population",
      "type": "quantitative",
      "axis": {
        "title": "Residents",
        "format": "~s",
        "tickCount": 5
      }
    },
    "color": {
      "field": "state",
      "type": "nominal"
    }
  },
  "endpointLabels": {
    "ends": "end",
    "content": "label"
  },
  "legend": {
    "show": false
  },
  "theme": {
    "colors": {
      "categorical": [
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        }
      ]
    }
  },
  "chrome": {
    "title": "Texas passed New York in 2000 and Florida passed it in 2020",
    "subtitle": "Resident population at each census, states that reached the top five, 1910-2020"
  },
  "data": [
    {
      "state": "California",
      "year": "1910",
      "population": 2377549
    },
    {
      "state": "California",
      "year": "1920",
      "population": 3426861
    },
    {
      "state": "California",
      "year": "1930",
      "population": 5677251
    },
    {
      "state": "California",
      "year": "1940",
      "population": 6907387
    },
    {
      "state": "California",
      "year": "1950",
      "population": 10586223
    },
    {
      "state": "California",
      "year": "1960",
      "population": 15717204
    },
    // … 78 more rows; Copy includes them
  ]
}
import { Chart } from "@opendata-ai/openchart-react";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 84 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": "line",
  "encoding": {
    "x": {
      "field": "year",
      "type": "temporal",
      "axis": {
        "format": "%Y"
      }
    },
    "y": {
      "field": "population",
      "type": "quantitative",
      "axis": {
        "title": "Residents",
        "format": "~s",
        "tickCount": 5
      }
    },
    "color": {
      "field": "state",
      "type": "nominal"
    }
  },
  "endpointLabels": {
    "ends": "end",
    "content": "label"
  },
  "legend": {
    "show": false
  },
  "theme": {
    "colors": {
      "categorical": [
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        }
      ]
    }
  },
  "chrome": {
    "title": "Texas passed New York in 2000 and Florida passed it in 2020",
    "subtitle": "Resident population at each census, states that reached the top five, 1910-2020"
  }
};

export function Example() {
  return <Chart spec={spec} />;
}
<script setup lang="ts">
import { Chart } from "@opendata-ai/openchart-vue";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 84 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": "line",
  "encoding": {
    "x": {
      "field": "year",
      "type": "temporal",
      "axis": {
        "format": "%Y"
      }
    },
    "y": {
      "field": "population",
      "type": "quantitative",
      "axis": {
        "title": "Residents",
        "format": "~s",
        "tickCount": 5
      }
    },
    "color": {
      "field": "state",
      "type": "nominal"
    }
  },
  "endpointLabels": {
    "ends": "end",
    "content": "label"
  },
  "legend": {
    "show": false
  },
  "theme": {
    "colors": {
      "categorical": [
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        }
      ]
    }
  },
  "chrome": {
    "title": "Texas passed New York in 2000 and Florida passed it in 2020",
    "subtitle": "Resident population at each census, states that reached the top five, 1910-2020"
  }
};
</script>

<template>
  <Chart :spec="spec" />
</template>
<script lang="ts">
import { Chart } from "@opendata-ai/openchart-svelte";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 84 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": "line",
  "encoding": {
    "x": {
      "field": "year",
      "type": "temporal",
      "axis": {
        "format": "%Y"
      }
    },
    "y": {
      "field": "population",
      "type": "quantitative",
      "axis": {
        "title": "Residents",
        "format": "~s",
        "tickCount": 5
      }
    },
    "color": {
      "field": "state",
      "type": "nominal"
    }
  },
  "endpointLabels": {
    "ends": "end",
    "content": "label"
  },
  "legend": {
    "show": false
  },
  "theme": {
    "colors": {
      "categorical": [
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        }
      ]
    }
  },
  "chrome": {
    "title": "Texas passed New York in 2000 and Florida passed it in 2020",
    "subtitle": "Resident population at each census, states that reached the top five, 1910-2020"
  }
};
</script>

<Chart {spec} />
import { createChart } from "@opendata-ai/openchart-vanilla";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";

const data = [/* 84 rows; Copy includes them */];

const spec: ChartSpec = {
  data,
  "mark": "line",
  "encoding": {
    "x": {
      "field": "year",
      "type": "temporal",
      "axis": {
        "format": "%Y"
      }
    },
    "y": {
      "field": "population",
      "type": "quantitative",
      "axis": {
        "title": "Residents",
        "format": "~s",
        "tickCount": 5
      }
    },
    "color": {
      "field": "state",
      "type": "nominal"
    }
  },
  "endpointLabels": {
    "ends": "end",
    "content": "label"
  },
  "legend": {
    "show": false
  },
  "theme": {
    "colors": {
      "categorical": [
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#64748b",
          "dark": "#94a3b8"
        },
        {
          "light": "#0e7490",
          "dark": "#22a3c4"
        }
      ]
    }
  },
  "chrome": {
    "title": "Texas passed New York in 2000 and Florida passed it in 2020",
    "subtitle": "Resident population at each census, states that reached the top five, 1910-2020"
  }
};

const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createChart(container, spec);

New York added 2 million people in the 50 years after 1970, while Texas added 18 million and Florida 14.7 million. The overtakes are still there, as crossings at the census where each happened. Seven lines fit on one chart here because the three climbers are teal and the rest gray; with more series, small multiples give each one its own panel.

Choosing between them

If the reader’s question is Use
Who was ahead at each point, and in what order did they pass each other? A bar chart race
How did each entry’s rank change over the whole period? A bump chart
How much did each grow, and how fast? A line chart
Who leads now? A ranked bar chart of the latest period
How do two dates compare? A slope chart

Pairing a race with a bump or line chart gives readers the sequence first and then lets them compare any two censuses.

The spec

The race is type: "race" with encoding.time on the census year, encoding.key on the state and encoding.value on the population, and it ranks the top 10 by default. Its rows cover only the 14 states that reach the top 10 at some census, since no other state could appear.

The bump chart is mark: "line" with point: true and each state’s rank among all 50 states on y. scale.reverse: true puts 1st at the top, and a domain from 1 to 33 leaves room for Florida’s start.

The line chart’s spec is printed above: endpointLabels names each line at its end, and theme.colors.categorical lists one color per state in alphabetical order, teal for the three climbers and gray for the rest.

To build a race from your own data, follow How to make a bar chart race in JavaScript.