Treemap chart

Show parts of a whole as nested areas in a treemap chart, in one or two levels: rectangles with exact areas, or cells inside a circle.

React
import { TreemapChart } from 'boardplot/react/treemap';
Use for
Many parts of one total, in groups · A few items take most of the total
Not for
Negative values, or values that do not add up to one whole; use bar for a ranking and waterfall for signed changes. Zero and null items are left out with a warning and a note.

Revenue growth by business area

Treemap, rectangular, 19 cells in 5 groups, total 17,843. Platforms 10,780 (60.4%): Core software 7,350, Cloud hosting 1,820, Data tools and services 1,610. Commerce 4,920 (27.6%): Online ads 3,080, Marketplaces 780, Streaming 410, Security 360, Gaming 290. Energy 950 (5.3%): Electric fleets 790, Storage 102, Small reactors 36, Hydrogen 22. Health 627 (3.5%): Weight care 612, Lab services 15. Machines 566 (3.2%): Orbital 398, Automation 105, Robotaxis 49, Air taxis 14, Prefab housing 0.4. Core software and online ads made up more than half of the ~$18 billion growth Revenue growth, by business area in $m · 2022–25 Source: Illustrative data Smaller items: Storage 102, Small reactors 36, Hydrogen 22, Lab services 15, Automation 105, Robotaxis 49, Air taxis 14, Prefab housing 0.4. Platforms 10,780 Commerce 4,920 Energy 950 Health 627 Machines 566 Core software 7,350 Online ads 3,080 Cloud hosting 1,820 Data tools and services 1,610 Electric fleets 790 Marketplaces 780 Weight care 612 Streaming 410 Orbital 398 Security 360 Gaming 290

Rectangular treemap of 19 business areas in five groups with a group key; Core software ($7,350m) and Online ads ($3,080m) are over half of the $17,843m growth.

Download SVG Fixture IDgrowth-rect
JSON spec

This spec includes the theme shown and the options you selected.

Changed from the fixture: options.unit; options.size from {"width":960,"height":600} to the width of the site frame.

{
  "type": "treemap",
  "data": {
    "groups": [
      {
        "id": "platforms",
        "label": "Platforms"
      },
      {
        "id": "commerce",
        "label": "Commerce"
      },
      {
        "id": "energy",
        "label": "Energy"
      },
      {
        "id": "health",
        "label": "Health"
      },
      {
        "id": "machines",
        "label": "Machines"
      }
    ],
    "items": [
      {
        "id": "core-software",
        "label": "Core software",
        "group": "platforms",
        "value": 7350
      },
      {
        "id": "cloud-hosting",
        "label": "Cloud hosting",
        "group": "platforms",
        "value": 1820
      },
      {
        "id": "data-tools",
        "label": "Data tools and services",
        "group": "platforms",
        "value": 1610
      },
      {
        "id": "online-ads",
        "label": "Online ads",
        "group": "commerce",
        "value": 3080
      },
      {
        "id": "marketplaces",
        "label": "Marketplaces",
        "group": "commerce",
        "value": 780
      },
      {
        "id": "streaming",
        "label": "Streaming",
        "group": "commerce",
        "value": 410
      },
      {
        "id": "security",
        "label": "Security",
        "group": "commerce",
        "value": 360
      },
      {
        "id": "gaming",
        "label": "Gaming",
        "group": "commerce",
        "value": 290
      },
      {
        "id": "electric-fleets",
        "label": "Electric fleets",
        "group": "energy",
        "value": 790
      },
      {
        "id": "storage",
        "label": "Storage",
        "group": "energy",
        "value": 102
      },
      {
        "id": "small-reactors",
        "label": "Small reactors",
        "group": "energy",
        "value": 36
      },
      {
        "id": "hydrogen",
        "label": "Hydrogen",
        "group": "energy",
        "value": 22
      },
      {
        "id": "weight-care",
        "label": "Weight care",
        "group": "health",
        "value": 612
      },
      {
        "id": "lab-services",
        "label": "Lab services",
        "group": "health",
        "value": 15
      },
      {
        "id": "orbital",
        "label": "Orbital",
        "group": "machines",
        "value": 398
      },
      {
        "id": "automation",
        "label": "Automation",
        "group": "machines",
        "value": 105
      },
      {
        "id": "robotaxis",
        "label": "Robotaxis",
        "group": "machines",
        "value": 49
      },
      {
        "id": "air-taxis",
        "label": "Air taxis",
        "group": "machines",
        "value": 14
      },
      {
        "id": "prefab-housing",
        "label": "Prefab housing",
        "group": "machines",
        "value": 0.4
      }
    ]
  },
  "options": {
    "title": "Core software and online ads made up more than half of the ~$18 billion growth",
    "subtitle": {
      "measure": "Revenue growth, by business area",
      "period": "2022–25"
    },
    "unit": "$m",
    "source": "Illustrative data",
    "notes": {
      "show": [
        "note",
        "disclosure"
      ]
    },
    "size": {
      "width": 1000
    }
  }
}

Revenue growth as a circular treemap

Treemap, circular, 19 cells in 5 groups, total 17,843. Platforms 10,780 (60.4%): Core software 7,350, Cloud hosting 1,820, Data tools and services 1,610. Commerce 4,920 (27.6%): Online ads 3,080, Marketplaces 780, Streaming 410, Security 360, Gaming 290. Energy 950 (5.3%): Electric fleets 790, Storage 102, Small reactors 36, Hydrogen 22. Health 627 (3.5%): Weight care 612, Lab services 15. Machines 566 (3.2%): Orbital 398, Automation 105, Robotaxis 49, Air taxis 14, Prefab housing 0.4. Core software and online ads made up more than half of the ~$18 billion growth, shown as circles Revenue growth, by business area in $m · 2022–25 Source: Illustrative data Platforms 10,780 Commerce 4,920 Energy 950 Health 627 Machines 566 Total ~$18 billion Core software 7,350 Online ads 3,080 Cloud hosting 1,820 Data tools and services 1,610 Electric fleets 790 Marketplaces 780 Weight care 612 Streaming 410 Orbital 398 Security 360 Gaming 290 Automation 105 Storage 102

Circular treemap of 19 business areas in five groups, from Core software (7,350) to small areas with leader labels; Platforms is 10,780 of about 18 billion dollars in growth.

Download SVG Fixture IDgrowth-circle
JSON spec

This spec includes the theme shown and the options you selected.

Changed from the fixture: options.title; options.unit; options.size from {"width":960,"height":760} to the width of the site frame.

{
  "type": "treemap",
  "data": {
    "groups": [
      {
        "id": "platforms",
        "label": "Platforms"
      },
      {
        "id": "commerce",
        "label": "Commerce"
      },
      {
        "id": "energy",
        "label": "Energy"
      },
      {
        "id": "health",
        "label": "Health"
      },
      {
        "id": "machines",
        "label": "Machines"
      }
    ],
    "items": [
      {
        "id": "core-software",
        "label": "Core software",
        "group": "platforms",
        "value": 7350
      },
      {
        "id": "cloud-hosting",
        "label": "Cloud hosting",
        "group": "platforms",
        "value": 1820
      },
      {
        "id": "data-tools",
        "label": "Data tools and services",
        "group": "platforms",
        "value": 1610
      },
      {
        "id": "online-ads",
        "label": "Online ads",
        "group": "commerce",
        "value": 3080
      },
      {
        "id": "marketplaces",
        "label": "Marketplaces",
        "group": "commerce",
        "value": 780
      },
      {
        "id": "streaming",
        "label": "Streaming",
        "group": "commerce",
        "value": 410
      },
      {
        "id": "security",
        "label": "Security",
        "group": "commerce",
        "value": 360
      },
      {
        "id": "gaming",
        "label": "Gaming",
        "group": "commerce",
        "value": 290
      },
      {
        "id": "electric-fleets",
        "label": "Electric fleets",
        "group": "energy",
        "value": 790
      },
      {
        "id": "storage",
        "label": "Storage",
        "group": "energy",
        "value": 102
      },
      {
        "id": "small-reactors",
        "label": "Small reactors",
        "group": "energy",
        "value": 36
      },
      {
        "id": "hydrogen",
        "label": "Hydrogen",
        "group": "energy",
        "value": 22
      },
      {
        "id": "weight-care",
        "label": "Weight care",
        "group": "health",
        "value": 612
      },
      {
        "id": "lab-services",
        "label": "Lab services",
        "group": "health",
        "value": 15
      },
      {
        "id": "orbital",
        "label": "Orbital",
        "group": "machines",
        "value": 398
      },
      {
        "id": "automation",
        "label": "Automation",
        "group": "machines",
        "value": 105
      },
      {
        "id": "robotaxis",
        "label": "Robotaxis",
        "group": "machines",
        "value": 49
      },
      {
        "id": "air-taxis",
        "label": "Air taxis",
        "group": "machines",
        "value": 14
      },
      {
        "id": "prefab-housing",
        "label": "Prefab housing",
        "group": "machines",
        "value": 0.4
      }
    ]
  },
  "options": {
    "title": "Core software and online ads made up more than half of the ~$18 billion growth, shown as circles",
    "subtitle": {
      "measure": "Revenue growth, by business area",
      "period": "2022–25"
    },
    "unit": "$m",
    "source": "Illustrative data",
    "variant": "circle",
    "total": "~$18 billion",
    "size": {
      "width": 1000
    }
  }
}

Unit sales share by region

Treemap, rectangular, 5 cells, total 1,000. North 412, South 268, East 190, West 96, Online 34. North and South sell two thirds of all units k units Source: Illustrative data North 412 (41%) South 268 (27%) East 190 (19%) West 96 (10%) Online 34 (3%)

One-level treemap of unit sales in thousands: North 412 (41%), South 268 (27%), East 190 (19%), West 96 (10%) and Online 34 (3%).

Download SVG Fixture IDone-level-shares
JSON spec

This spec includes the theme shown and the options you selected.

Changed from the fixture: options.size from the report frame to the width of the site frame.

{
  "type": "treemap",
  "data": {
    "items": [
      {
        "id": "north",
        "label": "North",
        "value": 412
      },
      {
        "id": "south",
        "label": "South",
        "value": 268
      },
      {
        "id": "east",
        "label": "East",
        "value": 190
      },
      {
        "id": "west",
        "label": "West",
        "value": 96
      },
      {
        "id": "online",
        "label": "Online",
        "value": 34
      }
    ]
  },
  "options": {
    "title": "North and South sell two thirds of all units",
    "unit": "k units",
    "source": "Illustrative data",
    "cellValue": "value-share",
    "size": {
      "width": 1000
    }
  }
}

Minimal spec

Save this spec as treemap.json and run the command.

{
  "type": "treemap",
  "data": {
    "groups": [{ "id": "core", "label": "Core" }, { "id": "new", "label": "New" }],
    "items": [
      { "id": "a", "label": "Product A", "group": "core", "value": 420 },
      { "id": "b", "label": "Product B", "group": "core", "value": 260 },
      { "id": "c", "label": "Product C", "group": "new", "value": 180 },
      { "id": "d", "label": "Product D", "group": "new", "value": 40 }
    ]
  },
  "options": {
    "title": "Core products earn three quarters of revenue",
    "unit": "$m",
    "source": "Illustrative data"
  }
}
npx boardplot render treemap.json --out treemap.svg