Treemap
A space-filling chart that shows hierarchical data as nested rectangles — the bigger the rectangle, the bigger the value. Ideal for visualizing hundreds of categories at once.
// 01 — The chart
What it looks like
A treemap showing disk space consumption by file type. Rectangle area encodes file size — videos clearly dominate storage usage.
// 02 — Definition
What is a treemap?
A treemap is a space-filling visualization that represents hierarchical data as a set of nested rectangles. Each rectangle’s area is proportional to the quantity it represents: a bigger rectangle means a bigger value. The entire chart fills a single rectangular space, making it extremely efficient at using screen real estate.
Unlike pie charts or donut charts that are limited to a handful of categories, treemaps can comfortably display dozens or even hundreds of items at once. The hierarchy is shown through nesting — large parent rectangles contain smaller child rectangles, letting you see both the overall structure and the fine-grained details simultaneously.
Treemaps are widely used in finance (stock market maps), technology (disk usage analyzers), and business intelligence (revenue breakdowns by product and region). They excel at revealing which items are the largest and spotting outliers in complex datasets.
Origin: The treemap was invented by Professor Ben Shneiderman at the University of Maryland in 1990. He created it to solve a very practical problem: visualizing the contents of a hard drive to find which files were consuming the most space. The “squarified” layout algorithm, which produces more readable rectangles, was introduced by Bruls, Huizing, and van Wijk in 2000.
// 03 — Anatomy
Parts of a treemap
// 04 — Usage
When to use it — and when not to
- You have hierarchical data with many categories (20+)
- You want to show part-to-whole relationships in a compact space
- Your data has two or three levels of nesting (e.g., sector → industry → company)
- Spotting the largest and smallest items is the primary goal
- Screen space is limited and you need to maximize data density
- You want to encode a second variable through color (e.g., growth rate)
- Precise comparison between values is important — rectangles are hard to compare exactly
- Your data is not hierarchical or part-to-whole — use a bar chart instead
- You have fewer than 5 categories — a simpler chart like a donut would suffice
- You need to show change over time — treemaps are for snapshots, not trends
- Your audience is unfamiliar with treemaps — they have a steeper learning curve
- Labels are critical but your smallest tiles are too small to contain text
// 05 — Reading guide
How to read a treemap
Follow these steps whenever you encounter a treemap in the wild.
Start with the biggest rectangles
The largest tiles jump out immediately — these are your dominant categories. Read their labels to understand what makes up the bulk of the whole. In a stock market treemap, these are the largest companies; in a budget treemap, the biggest spending categories.
Understand the hierarchy
Look for nesting or grouping borders. Parent categories contain child tiles. This tells you how the data is organized — for example, 'Technology' might contain 'Apple,' 'Microsoft,' and 'Google' as children.
Read the color encoding
If tiles use a color gradient (e.g., green to red), there's a second variable being shown — often a rate of change or performance metric. Check the legend to understand what color represents.
Compare relative sizes, not exact values
Treemaps are great for 'this is roughly twice as big as that' comparisons but poor for exact measurements. If a tile looks about the same size as another, they represent similar values.
Look for tiny tiles and empty space
Very small tiles at the edges indicate minor categories. If many small tiles cluster together, there's a 'long tail' of minor items. The absence of tiles in certain parent groups reveals where data is sparse.
// 06 — Common mistakes
Mistakes to watch out for
Too many hierarchy levels
More than 2–3 nesting levels makes the treemap extremely hard to read. Deep nesting produces tiny tiles with no room for labels. Flatten the hierarchy or provide drill-down interaction instead of showing everything at once.
Encoding size and color with the same variable
If both the tile area and its color represent the same metric, you're wasting a visual channel. Use area for one variable (e.g., revenue) and color for a second (e.g., year-over-year growth). This doubles the information density.
No labels on significant tiles
A treemap full of colored rectangles with no text is a colorful puzzle, not a chart. Always label at least the largest tiles. If small tiles can't fit labels, provide tooltips or a legend.
Using treemaps for time-series comparison
Placing two treemaps side by side to compare different time periods is nearly impossible — the tiles rearrange and resize unpredictably. Use a bar chart or slope chart for temporal comparisons.
Poor aspect ratios (long skinny rectangles)
Rectangles that are extremely tall and thin or wide and flat are hard for humans to compare by area. Use a squarified treemap algorithm, which tries to keep tile aspect ratios close to 1:1.
// 07 — Real-world examples
Where you’ll see treemaps used
Finance: Stock market heat maps
Financial platforms like Finviz use treemaps to visualize entire stock markets. Each tile is a company, sized by market capitalization. Color shows daily price change (green for up, red for down). Investors can instantly see which sectors are gaining and which are losing — across thousands of stocks in a single view.
FinanceTechnology: Disk space analyzers
Tools like WinDirStat and Disk Inventory X show file system usage as treemaps. Each tile is a file or folder, sized by bytes consumed. Users can instantly spot that one forgotten video file consuming 40 GB of their drive, or see that their Downloads folder is bigger than expected.
TechnologyBusiness: Revenue breakdown by product and region
A global company's quarterly report showing revenue as a treemap with two hierarchy levels: region → product line. The CEO can instantly see that North America drives the most revenue, and within it, SaaS subscriptions are the largest product, while hardware sales in APAC are surprisingly small.
Business Analytics// 08 — At a glance
Quick reference
// 09 — Variations
Types of treemaps
Different layout algorithms and visual approaches create distinct treemap variants.
Squarified treemap
Optimizes tile aspect ratios to be as close to square as possible, making area comparisons easier and more accurate.
Slice-and-dice treemap
The original layout: alternating horizontal and vertical slices. Preserves ordering but can produce very elongated rectangles.
Voronoi treemap
Uses irregular polygonal cells instead of rectangles. Visually striking and avoids the boxy look, but harder to implement and compare areas.
Cascaded treemap
Each parent node has a visible header bar with its label, and children are arranged below it. Makes the hierarchy very explicit.
// 10 — FAQs
Frequently asked questions
What is a treemap?+
A treemap is a space-filling visualization that represents hierarchical data as a set of nested rectangles. Each rectangle's area is proportional to the quantity it represents: a bigger rectangle means a bigger value. The entire chart fills a single rectangular space, making it extremely efficient at using screen real estate.
When should you use a treemap?+
Use a treemap when you have hierarchical data with many categories (20+). It also works well when you want to show part-to-whole relationships in a compact space, and when your data has two or three levels of nesting (e.g., sector → industry → company).
When should you avoid a treemap?+
Avoid a treemap when precise comparison between values is important — rectangles are hard to compare exactly. It is also a poor fit when your data is not hierarchical or part-to-whole — use a bar chart instead, or when you have fewer than 5 categories — a simpler chart like a donut would suffice.
How is a treemap different from a donut chart?+
Both a treemap and a donut chart can look similar at first glance, but they answer different questions. Reach for a treemap when the comparisons and patterns it was designed to reveal match what you need to communicate, and choose a donut chart when its particular strengths better fit your data and audience.
Is a treemap suitable for dashboards?+
Yes — a treemap can work well in dashboards as long as the panel is large enough for readers to perceive the encoded values, has a clear title, and includes the legend or axis labels needed to interpret it.
What category of chart is a treemap?+
Treemap belongs to the Part-to-whole family of charts. Charts in that family are designed to answer the same kind of question, so they often work as alternatives when one doesn't quite fit your data.