Treemap
Variant: Standard
Made-up data, for demonstration only
Variants
4 types · click one to see it in the frame above- Difference from standard
- The recommended type; use it as a starting point
- Use when
- Show multi-level composition with rectangular areas
Treemap is a chart that divides a large rectangle into smaller nested rectangles. The area of each cell is proportional to its value. Use it to see how a total is divided and to see the hierarchy at the same time, such as a budget by department.
How to read a Treemap
- The whole large rectangle is the total. This example is a total budget of $960 billion (made-up data).
- Each cell is one department, and its area is the size of its budget. Education is largest at $320 billion, about 33%, followed by Defense at 200, Public Health at 180, Transport at 150, and Agriculture at 110.
- Look at the area, not just the width or the height. A short but wide cell can be larger than a narrow but tall one.
- Sub-cells sit inside the group cell. In the "Two levels" variant you can see that Education splits into Basic Education 210, Higher Education 65 and Vocational Education 45. The largest sub-cell in the whole picture is Basic Education, about 22% of the whole budget.
You can see at once which part is large, but two cells of similar size are hard to compare.
When to use it
- The data is hierarchical and you want to see shares, such as budget by agency and project, sales by category and product, or disk space by folder.
- There are many items. A treemap uses space well, so it can show a lot of data.
- There are no more than 3 levels. The references warn that a static image with more than 3 levels is hard to read. If you have more, make it zoomable so readers can go one level at a time.
When not to use it
- You need to compare or rank values that are close. Area is hard to compare by eye. Use a Bar Chart.
- The data has no hierarchy and only a few parts. Use a Pie Chart or a Bar Chart.
- There are negative values. Area cannot be negative. Use a Waterfall Chart.
- There are many very small cells. Their labels cannot be read, and the chart is hard to read when it has lots of tiny parts.
Common mistakes
1. Labelling more than 3 levels
The picture cannot be read. Stress the top level first, and let readers click to see lower levels if the chart is interactive.
2. Using area for negative values
Area cannot be negative. Using absolute values changes the meaning. Move the negative parts to another chart.
3. Counting a parent and its children twice
The value of a group is the sum of its children. If you put the group and its children as cells at the same level, they are counted twice. Build the hierarchy correctly and check the totals before you draw.
Synthetic budget, 5 categories: neighbouring boxes are hard to compare exactly
Same data, all 5 categories: the numbers make comparison easier
4. Comparing cells of similar size by eye
Try the "Name and value" variant, which writes the value in each cell, so readers can compare more exactly. Small cells on a narrow screen do not have room for labels, so show only the top level, or let readers tap for details.
5. Using a different colour for every cell
Many colours make the picture busy. If you want colour to show value, try the "Color by value" variant, which uses darker and lighter shades by size.
Compared with similar charts
| Chart | How it differs | Choose it when |
|---|---|---|
| Treemap | Rectangles nested by size | A hierarchy and shares, with many items |
| Sunburst Chart | Rings nested by level | The structure matters more than size |
| Icicle Chart | Bars stacked downward by level | Levels are clear and long names are easy to read |
| Bar Chart | Bar length | You compare values accurately |
| Pie Chart | Angles in a circle | No more than 5 parts and no hierarchy |
History and development
Ben Shneiderman of the HCIL at the University of Maryland came up with the treemap around 1990. A shared 80 MB disk used by 14 people in his lab kept filling up, and he wanted to see which files or folders took the most space. The work appeared as an HCIL report in March 1991 and as an article in ACM Transactions on Graphics in January 1992.
Frequently asked questions
Does colour have to stand for size?
No. Colour can separate categories or stand for another variable. It needs a legend.
Must the total area be 100%?
No. You can use amounts of money or file sizes in a single unit. The whole area is the total.
Can I use a Treemap with no hierarchy?
Yes. You can show the values of several items with no hierarchy, like a bar chart.
Should it be interactive?
If there are more than 2 to 3 levels, let readers zoom in one level at a time, because a static version is hard to read.
References
- Treemaps for space-constrained visualization of hierarchies · Ben Shneiderman · HCIL, University of Maryland · www.cs.umd.eduUsed to confirm: the history and origin of the treemap
- Treemap · Data to Viz · www.data-to-viz.comUsed to confirm: how to read a treemap and what to watch for
- Visual Vocabulary (chart-doctor) · Financial Times · github.comUsed to confirm: grouping charts by the question they answer
- Data visualisation: charts · UK Government Analysis Function · analysisfunction.civilservice.gov.ukUsed to confirm: guidance on choosing and designing charts for official statistics
Last updated 28 Nov 2026