TreemapRectangles sized by value, nested by level.
One big rectangle cut into smaller ones, each as big as its value, with items nested inside their groups. Many parts of a whole in one picture.
- Answers What share does each part have?
- Your data items with a value, in groups
- Items 5 to hundreds
- Levels 1 to 3
- Excel and Power BI built in
- Fresh
- Drinks
- Household
What is a treemap?
A treemap fills one big rectangle with smaller rectangles, one per item, each as big as its value. Items are nested inside their groups, so a group's rectangle holds its items. It shows many parts of one whole at once, and which groups and items take the most room.
A supermarket's sales split into departments and products. A treemap shows Fresh food as the largest block, with fruit and vegetables its largest tile, while Household is small and split evenly.
Why use a treemap?
Because it fits many parts of a whole, in groups, into one rectangle.
- Many items fit. Dozens or hundreds of tiles in one picture.
- Groups and items together. The group's block and its tiles show both levels.
- The big ones stand out. Size is the first thing the eye sees.
- No wasted space. Every pixel shows data.
How does a treemap work?
Three steps cut a rectangle into tiles.
- Step 1 of 3The wholeOne rectangle stands for all sales.
- Step 2 of 3A block per departmentCut by size: Fresh takes more than half.
- Step 3 of 3Name themLabels go inside the tiles that fit them.
What are the parts of a treemap?
Four parts, and each one has a job.
- Fresh
- Drinks
- Household
- Groupholds its items
- Tileone item; its area is its value
- Wholethe full rectangle is the total
How do you read a treemap?
Three looks, in this order.
- Find the biggest groupFresh takes more than half the space.
- Fresh
- Drinks
- Household
- Find the biggest tileFruit is the largest single item.
- Fresh
- Drinks
- Household
- Compare inside a groupHousehold's two tiles are about the same size.
- Fresh
- Drinks
- Household
What kinds of treemap are there?
The same sales, three ways.
- Kind 1TreemapRectangles by size.
- Kind 2One litOne block in colour.
- Kind 3Bar chartBars: exact, but no sense of the whole.
When should you use a treemap?
When many parts of one whole, often in groups, must fit in one picture.
- there are many items that add up to a whole
- items sit in groups
- the big items are the story
- space is limited
- items must be compared exactly (a bar chart)
- there are only a few items (a bar chart or a pie)
- values can be negative (a bar chart)
- the hierarchy itself is the story (a tree or a sunburst)
Treemap or bar chart?
A treemap for many parts of a whole, bars for exact comparisons.
The bar chart ranks every item exactly: soft drinks beat bakery by 10. The treemap shows they are all part of one whole and roughly how big each piece is, but areas are hard to compare precisely.
How do you make a treemap?
Built into Excel, Power BI and Python libraries.
In Excel, choose Insert > Hierarchy chart > Treemap, with the group and item as columns. In Power BI, it is the treemap visual, with the group and item in Category and Details. The settings are in treemaps in Power BI. In Python, squarify and plotly draw one.
What goes wrong with treemaps?
The most common mistake, and its fix: comparing tiles of similar size.
- two tiles of 50 and 60 in different shapes look the same
- one long and thin, one square
- put the value in each tile that fits
- for exact ranking, add a bar chart beside
| Mistake | Why it hurts | Fix |
|---|---|---|
| Comparing tiles of similar size | Areas in different shapes fool the eye | Write the values, or bars |
| Too many tiny tiles | Unlabelled slivers | Group the small ones as "others" |
| Colour with no meaning | Readers look for one | Colour by group |
| Negative values | Areas can't be negative | A bar chart |
| Too many levels | Nested borders turn into noise | One or two levels |
Every chart for “What share does each part have?”
- One wholePie chartA circle cut into slices, for a few shares of one total.
- One wholeDonut chartA pie with a hole, with room for the total in the middle.
- One wholeWaffle chartA grid of 100 squares, each one per cent.
- One wholeParliament chartSeats in a half circle, coloured by party.
- Shares across groupsStacked bar chartBars split into parts, for totals and what makes them up.
- Shares across groups100% stacked bar chartEvery bar the same length, split into shares.
- Shares across groupsMarimekko chartStacked bars whose width is also a value, for two levels of share.
- Nested partsSunburst chartRings of a hierarchy, from the centre out.
- Nested partsIcicle chartA hierarchy as rows of blocks, each split into its children.
- Nested partsCircle packingCircles inside circles, sized by value, for a hierarchy.
- Building up to a totalWaterfall chartSteps up and down from a start to an end, for what changed a total.
- Building up to a totalPolar area chartWedges of equal angle whose length shows the value.
Read on, step by step.
Does it fit your data? Try it.
Paste your table into Chart Compass, say what the chart should show, and see the charts that fit, drawn with your own numbers. It runs in your browser, so the data stays with you.