Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _data/shared_chrome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://www.metabase.com/shared/chrome.schema.json",
"version": 1,
"generated_at": "2026-07-13T09:16:21+00:00",
"generated_at": "2026-07-14T13:30:52+00:00",
"origin": "https://www.metabase.com",
"stylesheets": [
{
Expand Down Expand Up @@ -106,7 +106,7 @@
"attributes": {
"type": "application/ld+json"
},
"children": "\n {\n \"@context\": \"https://schema.org\",\n \"@type\": \"Organization\",\n \"url\": \"https://www.metabase.com/\",\n \"sameAs\": [\n \"https://github.com/metabase\",\n \"https://www.linkedin.com/company/metabase/\",\n \"https://x.com/metabase\",\n \"https://www.youtube.com/@metabasedata\"\n ],\n \"logo\": \"https://github.com/metabase/metabase.github.io/blob/master/images/metabase-logo.png?raw=\",\n \"name\": \"Metabase\",\n \"description\": \"Metabase is an open source Business Intelligence and Embedded Analytics tool. Connect to your data stack in 5 minutes to make queries, visualizations, and dashboards easy for everyone—no SQL required\",\n \"email\": \"hello@metabase.com\",\n \"foundingDate\": \"2015-02-01T00:00:00.000Z\",\n \"address\": {\n \"@type\": \"PostalAddress\",\n \"streetAddress\": \"9740 Campo Rd\",\n \"addressLocality\": \"Spring Valley\",\n \"addressCountry\": \"USA\",\n \"addressRegion\": \"CA\",\n \"postalCode\": \"91977\"\n },\n \"knowsAbout\": [\n { \"@type\": \"Thing\", \"name\": \"Business Intelligence\" },\n { \"@type\": \"Thing\", \"name\": \"Embedded Analytics\" },\n { \"@type\": \"Thing\", \"name\": \"Self-service analytics\" },\n { \"@type\": \"Thing\", \"name\": \"Open source Business Intelligence\" }\n ]\n }\n"
"children": "\n {\n \"@context\": \"https://schema.org\",\n \"@type\": \"Organization\",\n \"@id\": \"https://www.metabase.com/#organization\",\n \"url\": \"https://www.metabase.com/\",\n \"sameAs\": [\n \"https://github.com/metabase\",\n \"https://www.linkedin.com/company/metabase/\",\n \"https://x.com/metabase\",\n \"https://www.youtube.com/@metabasedata\"\n ],\n \"logo\": \"https://github.com/metabase/metabase.github.io/blob/master/images/metabase-logo.png?raw=\",\n \"name\": \"Metabase\",\n \"description\": \"Metabase is an open source Business Intelligence and Embedded Analytics tool. Connect to your data stack in 5 minutes to make queries, visualizations, and dashboards easy for everyone—no SQL required\",\n \"email\": \"hello@metabase.com\",\n \"foundingDate\": \"2015-02-01T00:00:00.000Z\",\n \"address\": {\n \"@type\": \"PostalAddress\",\n \"streetAddress\": \"9740 Campo Rd\",\n \"addressLocality\": \"Spring Valley\",\n \"addressCountry\": \"USA\",\n \"addressRegion\": \"CA\",\n \"postalCode\": \"91977\"\n },\n \"knowsAbout\": [\n { \"@type\": \"Thing\", \"name\": \"Business Intelligence\" },\n { \"@type\": \"Thing\", \"name\": \"Embedded Analytics\" },\n { \"@type\": \"Thing\", \"name\": \"Self-service analytics\" },\n { \"@type\": \"Thing\", \"name\": \"Open source Business Intelligence\" }\n ]\n }\n"
},
{
"tag": "script",
Expand Down
3 changes: 3 additions & 0 deletions _docs/v0.63/developers-guide/driver-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ layout: new-docs

## Metabase 0.63.0

- New driver method `metabase.driver/refresh-table-stats!` `[driver database schema table transform-type]` --
refreshes table statistics (e.g. `ANALYZE`) after a transform run. Defaults to a no-op.

- `metabase.driver/describe-table-fks`, deprecated in 0.49.0, has been removed. Please implement
`metabase.driver/describe-fks` instead. This method is now required for drivers that support
`:metadata/key-constraints`.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _docs/v0.63/questions/images/treemap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
103 changes: 103 additions & 0 deletions _docs/v0.63/questions/visualizations/treemap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
version: v0.63
has_magic_breadcrumbs: true
show_category_breadcrumb: true
show_title_breadcrumb: true
category: Questions
title: Treemaps
source_url: 'https://github.com/metabase/metabase/blob/master/docs/questions/visualizations/treemap.md'
layout: new-docs
summary: 'Visualize hierarchical data as nested rectangles, where a metric sets the size of each rectangle.'
---

# Treemaps

Treemap visualizations display hierarchical data (a tree) as nested rectangles. The rectangles at the lowest level of the hierarchy are called leaves. The value of a metric determines the size of each leaf. Larger values take up more area than smaller values.

When you group by two dimensions, the first dimension determines the parent categories. The second dimension nests inside the parent categories as leaves.

![Treemap](../images/treemap.png)

This treemap groups a metric, the count of orders, by two dimensions. The first dimension is product category (the larger rectangles), and the second is vendor (the nested leaves within each category).

## When to use a treemap

Use a treemap to compare how a total breaks down by one categorical dimension, or by a second categorical dimension nested within the first.

Treemaps show how much each category contributes to a total. They work best when you have many categories to break down, where a pie chart splits into thin slices and a bar chart runs long. A treemap keeps many categories readable in a compact space, and it can nest a second dimension inside the first. For example, you can show order counts by product category, then break each category down by vendor.

Treemaps are a weaker choice for comparing categories against each other, because area is harder to judge than bar length. For a single dimension with only a few categories, use a [pie chart](./pie-or-donut-chart) or a [bar chart](./line-bar-and-area-charts).

## Data shape for a treemap

To create a treemap, create a question that returns a single metric grouped by one or two dimensions.

When you group a metric by one dimension, the treemap shows a flat set of leaves with no parent categories. Here's the data shape for a treemap of order count by category:

| Category | Count |
| --------- | ----- |
| Widget | 612 |
| Gadget | 562 |
| Gizmo | 491 |
| Doohickey | 462 |

![Treemap grouped by one dimension](../images/treemap-one-dimension.png)

When you group a metric by two dimensions, the treemap nests the second dimension inside the first. The first dimension determines the outer rectangles and their colors. The second dimension determines the leaves nested inside the outer rectangles. The value of the metric determines each leaf's size.

Here's the data shape for a treemap of order count by category (the parent categories) and vendor (the leaves):

| Category | Vendor | Count |
| --------- | -------------------------- | ----- |
| Widget | Jerrell Gulgowski Inc | 26 |
| Widget | Brittany Mueller Inc | 25 |
| Gadget | Jerrod McLaughlin LLC | 24 |
| Gadget | Miles Ryan Group | 22 |
| Gizmo | Mr. Tanya Stracke and Sons | 30 |
| Doohickey | Kuhn-O'Reilly | 27 |

![Treemap grouped by two dimensions](../images/treemap.png)

## Build a query for a treemap

To build a nested treemap:

1. In the query builder, click **Summarize**.
2. Select a metric, such as **Count of rows**.
3. Group by a first dimension, such as **Category**.
4. Add a second grouping, such as **Vendor**.
5. In the visualization picker, select **Treemap**.

The order of the groupings matters. The first grouping determines the outer rectangles, and the second grouping determines the leaves nested in each outer rectangle.

Click a parent category to zoom into that category.

## Drill-through

- **Parent category**: Click a parent category to zoom into that category. To return to the full treemap, click the back arrow.
- **Leaf**: Click a leaf to view the underlying records, break out by another dimension, view automatic insights, or filter by its value.

[Drill-through](./drill-through) options are limited for questions written in SQL.

## Treemap settings

To open chart settings, click the **Gear** icon in the bottom left of the visualization.

### Data

In chart settings, click the **Data** tab to configure the chart's groupings and value.

- **Grouping:** The dimension that determines the parent categories. To set a custom color for a parent category, click the color swatch next to the category's name. To rename a parent category, click the **...** next to the category's name.
- **Sub-grouping:** The dimension that nests inside each parent category as leaves. Requires a query with at least two dimensions.
- **Value:** The metric that determines the size of each leaf. To format the value, click the **...** to open the formatting menu. You can set the number style, separator style, number of decimal places, a multiplier, and a prefix or suffix.

### Display

In chart settings, click the **Display** tab to show or hide labels and values. You can toggle **Show parent labels**, **Show parent values**, **Show leaf labels**, and **Show leaf values**.

## Limitations and alternatives

- Treemaps display a single metric grouped by one or two dimensions. If your query returns more than one metric, the treemap uses the metric you select in the **Value** slot.
- When a query returns more than two dimensions, the treemap uses the dimensions in the **Grouping** and **Sub-grouping** slots and combines any unused dimensions into each leaf. A treemap doesn't nest beyond two levels.
- When one leaf is far larger than the other leaves, the small leaves can become too small to see or select.
- Treemaps favor part-to-whole comparison. To compare category values against each other, use a [bar chart](./line-bar-and-area-charts), or use a [pie chart](./pie-or-donut-chart) for a small number of categories.
6 changes: 6 additions & 0 deletions _docs/v0.63/questions/visualizations/visualizing-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ A [sunburst chart](./pie-or-donut-chart) is a pie chart with more than one ring

![Pivot table options](../images/pivot-table-options.png)

## Treemaps

[Treemaps](./treemap) display hierarchical data as nested rectangles, sized by a metric. Use them to break a total down across one or two nested categorical dimensions.

![Treemap](../images/treemap.png)

## Progress bars

[Progress bars](./progress-bar) are for comparing a single number to a goal value that you set.
Expand Down