Compare and rank

Bar chart race

Animates category bars through time to show changes in rank and magnitude.

  • Chart
  • Ranking
  • Trend over time

What it answers

Who leads at each time and when do leaders change?

Shape
Animated ranked bars
What it shows
Turnover, entry, exit and changing magnitude.

Example

The question

How has the ranking of cities by customer numbers changed year by year?

Customers by city, one frame of an animated race (thousands)

Customers by city, one frame of an animated race (thousands)Frame for 2025 of an animation that runs 2019 to 2025. Stockholm 48; Oslo 41; Copenhagen 39; Helsinki 30; Malmö 22.0102030405060Customers, thousandsStockholm48Oslo41Copenhagen39Helsinki30Malmö222025
Customers by city, one frame of an animated race (thousands)Frame for 2025 of an animation that runs 2019 to 2025. Stockholm 48; Oslo 41; Copenhagen 39; Helsinki 30; Malmö 22.0102030405060Customers, thousandsStockholm48Oslo41Copenhagen39Helsinki30Malmö222025
Frame for 2025 of an animation that runs 2019 to 2025. Stockholm 48; Oslo 41; Copenhagen 39; Helsinki 30; Malmö 22.

Illustrative data. It belongs to no company.

When to use it

Use it when

Presenting rank changes over many periods.

Avoid it when

When exact cross-period comparison or reduced-motion access is essential without a static alternative.

How to read it

Use time controls, follow labels and pause to compare bar lengths.

Note

Keep category identity consistent across frames.

The data you need

Layout
Long table
Fields
Period: ordered date/number; Item: text; Value or Rank: number
One row is
One item in one period. What is the grain?
Rules
If deriving ranks, state ascending/descending order and tie rules. Explicitly distinguish rank from magnitude.
Optional
Optional precomputed Rank. Fill missing periods only under a stated rule.
Preparation
Aggregate and rank within every frame; align item IDs, dates and animation scale rules.
Units
Use the measured variable's stated unit consistently. No denominator is implied unless the value is a rate or proportion.
Example of the input layout: Long tableA long table: one row per observation, few columns. New data adds rows.PeriodItemValue or RaAABBC
A long table: one row per observation, few columns. New data adds rows.

Worked example

Data Jan: A30, B45; Feb: A50, B40. Animate between ranked frames. A overtakes B; provide the same two frames statically.

PeriodItemValue
2026-01A30
2026-01B45
2026-02A50
2026-02B40