{
  "id": "compare-toggle",
  "name": "Compare toggle",
  "family": "compare",
  "tier": "pro",
  "summary": "Use a compare toggle to switch one chart between two fair ways of measuring, so readers see how the ranking flips.",
  "title": "China emits the most CO2, but of the ten biggest emitters Saudi Arabia emits the most per person",
  "subtitle": "Carbon dioxide from fossil fuels and industry, the ten largest emitters, 2025: total tonnes or tonnes per person",
  "howToRead": "Total ranks countries by all their emissions; Per person divides by population, and the bars re-sort.",
  "useWhen": [
    "two measures of the same thing tell different stories (total vs per person, count vs rate)",
    "the ranking itself changes",
    "you want readers to discover the flip themselves"
  ],
  "avoidWhen": [
    "the two measures need to be read together (use a scatter)",
    "the switch changes the set of items, not just their order",
    "more than two framings (use small multiples)"
  ],
  "fields": [
    {
      "name": "year",
      "type": "year",
      "optional": true,
      "description": "optional: the year, shown in the heading"
    },
    {
      "name": "world",
      "type": "number",
      "optional": true,
      "description": "optional: the whole's two measures (the world in the example), for the reference line (hints.reference names it); without it the detail compares with the sum of the rows",
      "unit": "tonnes",
      "format": "compact"
    },
    {
      "name": "countries[].country",
      "type": "category",
      "description": "the country"
    },
    {
      "name": "countries[].total",
      "type": "number",
      "sign": "non-negative",
      "description": "the first measure, a total (CO2 emitted, tonnes); its button is hints.names.total, else this description up to the comma",
      "unit": "tonnes",
      "format": "compact"
    },
    {
      "name": "countries[].perPerson",
      "type": "number",
      "sign": "non-negative",
      "description": "the second measure, the same thing per person or as a rate (CO2 emitted per person, tonnes); its button is hints.names.perPerson",
      "unit": "tonnes",
      "format": "decimal"
    }
  ],
  "interactions": [
    "the two measure buttons (Total and Per person) switch the comparison",
    "hover or tap a bar to read both measures"
  ],
  "motion": "On switching, bars resize to the new scale and slide to their new rank, so you can follow each country.",
  "sound": "A whoosh on the switch; a pop on hover pitched by rank. Quiet while it draws and between steps; mute it from its card.",
  "annotations": [
    {
      "type": "underline",
      "words": "Saudi Arabia",
      "in": "title",
      "style": "underline"
    }
  ],
  "tags": [
    "toggle",
    "switch",
    "per capita",
    "ranking",
    "reframe",
    "climate",
    "co2",
    "emissions"
  ],
  "hints": {
    "highlight": [
      "China",
      "United States",
      "India",
      "Saudi Arabia"
    ],
    "names": {
      "total": "Total",
      "perPerson": "Per person"
    },
    "reference": "world"
  },
  "mobile": "adapts",
  "mobileNote": "Draws its own phone layout below 520px",
  "mobileChecked": "2026-12-02",
  "ratios": [
    "16:9",
    "9:16"
  ],
  "bestRatio": "9:16",
  "source": {
    "title": "Annual CO2 emissions and CO2 emissions per capita",
    "publisher": "Our World in Data (Global Carbon Budget)",
    "url": "https://ourworldindata.org/grapher/co-emissions-per-capita",
    "license": "CC BY 4.0",
    "retrieved": "2026-12-01"
  },
  "note": "Territorial emissions: CO2 released inside each country, not counting what its imports cause abroad."
}