Data Trends>Data Visualization

What Is a Tree Map? A Practical Treemap Guide

key-takeawayKey Takeaways

  • A treemap uses nested rectangles to show hierarchy and relative share.
  • Rectangle area represents value, while nesting shows how smaller categories belong to larger groups.
  • UK Government Analysis Function guidance recommends bars when several categories are similar in size.
  • Good labels, non-color cues, contrast, and text alternatives address key readability and accessibility needs.
  • Your analytical question should choose the chart, not the novelty of the format.

You need to show how a total breaks into layers, but a long bar chart takes over the page. A treemap can help when your data has a hierarchy and you want to see larger contributors in context.

A treemap divides a rectangular area into smaller rectangles. Their size represents associated values, and their nesting represents hierarchy. This guide uses “treemap” because D3 and ThoughtSpot documentation use that term.

What Is a Treemap and How Does It Work?

A treemap is a hierarchical data visualization made of rectangles inside rectangles. According to D3 by Observable’s explanation of how treemaps encode values, the layout recursively divides area according to each node’s associated value.

That definition gives you the two ideas that matter most. First, the chart starts with a hierarchy, such as a company, its departments, and the teams inside each department. Second, rectangle area carries the measure, such as budget, inventory value, revenue, or headcount.

A treemap does not map physical trees or locations. The “tree” refers to the branching data structure behind the chart. For a ThoughtSpot overview of chart-selection basics, see its guide to what a chart is.

Color may add a second layer of context. You could use color to distinguish departments or show whether a metric falls into a defined range. Still, area and nesting define the treemap; color is an optional design choice.

How Rectangle Size and Nesting Carry Meaning

Start with the outer rectangle, which represents the full dataset. Inside it, larger parent rectangles represent major groups, while smaller child rectangles represent the categories within each group. The smallest visible units are often called leaf nodes.

Imagine a product portfolio. The outer frame represents the full portfolio, parent rectangles represent product families, and child tiles represent individual products. One large family rectangle tells you that the family accounts for a large share of the selected measure.

Within that family, a large product tile suggests a major contributor. A cluster of small tiles shows fragmentation across many smaller items. If exact order matters, use labels, tooltips, or another chart chosen for ranking.

ThoughtSpot documentation describes configuration options for labels, legends, colors, and other visualization settings.

When Should You Use a Treemap?

Use a treemap when your question involves both hierarchy and composition. The data should roll up into a meaningful whole, and the main task should be spotting broad differences in share or scale.

The UK Government Analysis Function’s chart selection guidance lists treemaps for part-to-whole relationships. It also recommends line charts for time-series questions about changes and trends.

A treemap can fit questions such as:

  • How is a budget divided across departments and teams?

  • Which product categories account for most inventory value?

  • How does a portfolio break down by region and segment?

  • Which expense groups dominate a cost structure?

  • How is website traffic distributed across sections and pages?

In each case, the reader wants the shape of the whole before the exact ranking of every item. ThoughtSpot Cloud 26.10.0.cl documentation describes treemaps as an efficient way to display many items.

For a ThoughtSpot overview of chart formats, see its guide to types of charts and graphs. Compare the formats against the question your audience needs to answer.

When a Bar Chart or Another View Is Clearer

The UK Government Analysis Function’s treemap interpretation guidance advises using a bar chart instead when several categories are similar in size. For static treemaps, it also recommends five categories or fewer, a meaningful whole, and a dominant category. Treat those criteria as guidance for its publishing context, not a universal threshold.

Choose another view when the task changes:

  • Follow the UK guidance and use a bar chart when several categories are similar in size.

  • For time-series changes and trends, follow its recommendation to use a line chart.

  • Use a table when exact lookup is the main job.

  • Use a map when geography is the organizing structure.

  • Use a stacked bar when composition needs a shared baseline.

Interactive treemaps can reveal smaller branches after a reader selects a larger group. The same UK guidance says this interaction can support deeper breakdowns. Still, the accessibility of that behavior needs assessment.

How Do You Read and Build a Treemap?

Reading a treemap gets easier when you follow the hierarchy instead of scanning every tile at once. Begin with the largest parent rectangles, then move into the children inside each group. Compare siblings first, because tiles under the same parent share the clearest context.

Use this sequence:

  1. Identify the full population represented by the outer frame.

  2. Find the largest parent groups.

  3. Compare child tiles within the same parent.

  4. Read labels or tooltips for exact values.

  5. Check the legend before interpreting color.

  6. Look for categories that are too small to label or select.

When you build a treemap, start with the analytical question. Then define the hierarchy, choose the associated value, and decide whether color adds useful context. ThoughtSpot Cloud documentation includes a dedicated treemap chart type that visualizes related categories as nested rectangles.

Next, order the tiles for easier scanning and write labels that fit the available space. If color represents a second measure, use a clear legend and a restrained scale. For ThoughtSpot’s own guidance, see its data visualization best practices.

Finally, test the chart with the people who will use it. Can they identify the largest group and retrieve an exact value?

Can they explain what color means? If the answers are shaky, simplify the hierarchy or choose a different chart.

A Simple Treemap Example

Suppose you are reviewing an annual operating budget. The full rectangle represents the total budget, parent rectangles represent departments, and child rectangles represent teams. Rectangle area corresponds to each group’s budget allocation.

A large operations rectangle tells you that operations takes a large share of the total. Inside it, a large facilities tile may stand out beside smaller logistics and procurement tiles. That pattern supports a broad composition statement, but it does not explain why the allocation exists or whether it is appropriate.

Now imagine that finance and marketing have nearly equal parent rectangles. The treemap shows that their shares are similar, but it may not reveal the exact order at a glance. Add direct labels or tooltips, or pair the view with a table when the difference matters.

How Can You Design a Clear, Accessible Treemap?

A treemap can become cluttered quickly, especially when the hierarchy is deep or many tiles are small. Good design reduces the reader’s workload by keeping each visual signal focused on one job.

Use this checklist:

  • Keep the hierarchy shallow enough to follow.

  • Reserve labels for tiles with readable space.

  • Add tooltips or a table for exact values.

  • Use consistent borders to clarify parent groups.

  • Sort tiles in a predictable order where the layout allows it.

  • Limit color to a useful category or measure.

  • Test the chart at its real display size.

Accessibility needs more than an attractive palette. W3C’s WCAG color and contrast requirements say color must not be the only visual means of communicating information.

WCAG 2.2 also calls for equivalent text alternatives for non-text content. Where Success Criterion 1.4.11 applies, required graphical objects need 3:1 contrast against adjacent colors.

For a treemap, pair color with labels, patterns, borders, or another visible cue. Provide a text summary that states the main composition pattern, and make exact values available outside color alone. If the chart is interactive, test keyboard access, focus order, tooltip behavior, and screen-reader output.

Contrast by itself does not make a treemap accessible. A chart may meet a contrast threshold while hiding values behind pointer-only tooltips or presenting an unreadable focus sequence. Accessibility comes from the full reading and interaction experience.

Choose the Treemap That Fits Your Question

A treemap earns its place when you need to show a hierarchy and its broad composition in one bounded view. Use rectangle size for relative share, nesting for structure, and color only when it adds clear context. For time-series changes and trends, the UK Government Analysis Function recommends a line chart.

Want to compare formats against your own analytical question? Explore ThoughtSpot’s interactive charts and dashboards, then choose the chart that makes the answer easiest to read.

The Leader in Agentic Analytics

2026 Leader

2026 Leader

2026 G2 Enterprise

2026 G2 Enterprise

2026 G2 SMB

2026 G2 SMB

2026 G2 Momentum

2026 G2 Momentum