DataVisuals.XYZ
  1. Home
  2. Chart guide
  3. Treemap

Chart

Treemap

When a treemap works for nested part-to-whole data, why area is hard to compare, how to label small rectangles, and when sorted bars are the better choice.

By DataVisuals TeamUpdated 5 min read

Best for
Showing how one total splits into groups and subgroups, such as a budget by department and team, or sales by category and product.
Avoid when
Readers need to rank or compare similar values precisely, or there is no hierarchy and only a few parts (use a sorted bar chart).
Data you need
One or more category columns that nest (group, then subgroup) and one positive numeric value per row.

A treemap fills a rectangle with smaller rectangles, each sized by its value. Groups are drawn as blocks, and each block is divided into its own parts. A company budget might show Engineering as one large block split into Platform, Mobile and Data teams, next to smaller blocks for Sales and Marketing.

It's good at one thing: showing the structure of a total with many parts, and where the big pieces are, in a small space. It's weak at precise comparison, because readers judge areas poorly, and rectangles with different shapes are even harder to compare than slices of a pie.

When to use a treemap

Use a treemap when your data has a hierarchy and the question is "where does the total go?" Good examples:

  • A budget by department and team
  • Sales by product category and product
  • Disk space by folder and file
  • Market value by sector and company
  • Website traffic by section and page

Treemaps handle dozens or even hundreds of items, which is where they beat a pie chart. Small items become tiny rectangles, but they don't break the chart the way slivers break a pie.

They only work for positive values that add up to something meaningful. Sales, costs, counts and time all work. Growth rates, averages and profit (which can be negative) do not.

How to read a treemap

Each rectangle's area is proportional to its value. Rectangles in the same group share a border and usually a color, and the group's total is the area of its whole block.

AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYTo4NmViOGYyMC1hZDI4LTQ2YmYtOGRlMS0yMDg0MGEwNDcxYWYAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaF6EZONM3GBfRdXALuHHqJgAAABwY2JvcqNpZGM6Zm9ybWF0bWltYWdl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00aoW4KdTodI4+AmWhFLf9mGDek0d7d+d6y+q+zDFmw=Two-level treemapBudget by department and team, $M (total 95)Platform 18Mobile 11Data 8QA 4EngineeringField 12Inside 73SalesPaid media 9Events 5Content 3MarketingTier 1 64Support3Legal 2G&APaid media is the largest line in Marketing
Fig. 1 A $95M budget split into five departments and their teams. Engineering takes the largest block. Within Marketing, Paid media is the biggest team, highlighted so the reader knows where to look.

Most tools use a "squarified" layout, which keeps rectangles as close to square as possible. Squares are easier to compare than long thin strips, and their labels fit better. The cost is that the layout ignores any natural order, so the position of a rectangle carries no meaning. Big items tend to land top-left and small ones bottom-right, but that is a side effect of sorting, not a rule readers can rely on.

Area is hard to judge

People compare lengths on a common baseline accurately and areas poorly. Asked whether one rectangle is twice as big as another, most readers guess low. When the rectangles also have different proportions, one tall and narrow, one short and wide, the judgment gets worse.

AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYTowNmFlZDNmMy0wOTI2LTQ3MTYtODczYi1kYjhmNjMyMDFiODcAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaMSBI1IZAwCaiRPtZzSivW0AAABwY2JvcqNpZGM6Zm9ybWF0bWltYWdlL3N2Zyt4bWxqaW5zdGFuY2VJRHgseG1wOmlpZDplMTcxY2FmNC01YWY2LTQ0MTktYTE4Zi0wYjVmMTk1ZDgyYTJscmVsYXRpb25zaGlwaHBhcmVudE9mAAAB4mp1bWIAAABBanVtZGNib3IAEQAQgAAAqgA4m3ETYzJwYS5hY3Rpb25zLnYyAAAAABhjMnNo28mwlY0Ji+ehA50I9BiLWAAAAZljYm9yomdhY3Rpb25zgqJmYWN0aW9ua2MycGEub3BlbmVkanBhc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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQFj1FWsjeDongR7C/ZfgEUQRuXNoRm0DNeDtOl+d+koSR96PWZB2VFumLA8fS8EPpepRaQhO4Zkx8opD3QEbe1U=Treemap versus sorted barsTreemap: which is bigger?RentPayrollSoftwareTravelOtherSoftware or Travel? Hard to tellSorted bars: easyRent31%Payroll28%Software14%Travel12%Hardware7%Training5%Other3%Software, 14% to 12%
Fig. 2 Operating costs in seven categories. In the treemap, Software (14%) and Travel (12%) are hard to rank by eye. Sorted bars make the order and the gap obvious, and the small categories get readable labels too.

So use a treemap for the big picture ("Rent and payroll are well over half of costs") and not for close calls. If the story depends on telling 14% from 12%, print the numbers on the chart or use bars.

Rule of thumb: if your treemap has one level and fewer than about ten items, a sorted bar chart will be clearer.

Labeling a treemap

Labels make or break a treemap, and small rectangles have no room for them. A few practical rules:

  • Put the label in the top-left corner of each rectangle, with the name and value ("Platform 18").
  • Hide labels that don't fit instead of shrinking the text until it's unreadable. Tools can usually do this automatically.
  • Label the groups separately, with a heavier border around each group and the group name in its corner.
  • Make sure every item you mention in the text has a visible label, even if that means enlarging the chart.

Text color must contrast with the rectangle's fill. With a dark fill use light text, and with a light fill dark text. When colors vary by value, check the extremes.

Interactive treemaps can rely on tooltips for the small rectangles, but don't let that excuse a chart where nothing is labeled. A reader on a phone may never hover.

Color: groups or values

Color can do one of two jobs in a treemap, and mixing them confuses readers.

The first job is showing the groups. Each top-level category gets its own color, and its children share it, maybe in lighter or darker tones. This makes the hierarchy readable at a glance.

The second job is showing a second measure. Area shows size (market value, say) while color shows change (daily percentage move), usually with a diverging scale centered on zero. The well-known stock market treemaps work this way. When color shows a value, add a legend and use group borders to show the hierarchy.

In either case, keep a strong highlight color free for the one rectangle you want to talk about, as in the budget example above. The labels and annotations guide covers how to pair that highlight with a short note.

When a sorted bar chart is better

A treemap earns its place through hierarchy and volume. Without them, a bar chart wins.

Situation Better choice
One level, under ten items Sorted bar chart
Readers need to rank similar values Sorted bar chart with labels
Two levels, many items, big picture matters Treemap
Parts of a whole across several periods Stacked bar chart
Hundreds of items, readers explore Interactive treemap
Values can be negative Bar chart or waterfall

Another honest option is to use both: a treemap to show the overall structure, followed by a sorted bar chart of the top items with exact numbers.

Common mistakes

Mistake Why it hurts Fix
Treemap for a handful of flat values Area hides easy comparisons Sorted bar chart
Three or more levels in a static chart Rectangles too small to read Two levels, or make it interactive
Unlabeled rectangles Reader can't tell what anything is Label all that fit, note the rest
Negative or average values Area can't represent them Use bars
Color for both groups and values Mixed signals Pick one job for color
Asking readers to rank similar areas Area judgment is weak Print values or use bars

A treemap answers "what is this total made of?" well and "which of these is bigger?" badly. Use it for the first question and pair it with bars for the second.

Questions

Can a treemap show negative values?

No. Rectangle area can't be negative, so a treemap only works for positive quantities that add up to a total. For profit and loss, use a bar chart with a zero line or a waterfall chart.

How many levels should a treemap have?

Two levels is usually the limit for a static chart. A third level makes rectangles too small to label. Interactive treemaps can go deeper by letting readers click into a group.

What is the difference between a treemap and a pie chart?

Both show parts of a whole, but a treemap fits many more parts in the same space and can show a hierarchy. Both rely on area, so neither is good for precise comparison.