> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lightdash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Treemap chart

> Use treemap charts to show parts of a whole using nested rectangles

Treemaps show parts of a whole using nested rectangles. Each rectangle's size represents the value of a metric, and dimensions define how the data is grouped and nested. You can use a single dimension or multiple and they will work as described below.

**One dimension**: Each category becomes a rectangle, sized by the metric value.

![A treemap of one dimension: a rectangle per category, each sized by its metric value](https://mintcdn.com/lightdash/6PKvTpisKKqbaQZk/images/visualizations/treemap-chart/treemap-single-dim.png?fit=max\&auto=format\&n=6PKvTpisKKqbaQZk\&q=85\&s=520743889f6ef8fcd09c29b60dcfdaff)

**Two dimensions**: Creates a hierarchy where each rectangle is split into sub-rectangles based on the second dimension.

![A treemap of two dimensions, where each top-level rectangle is subdivided into smaller rectangles for the second dimension](https://mintcdn.com/lightdash/6PKvTpisKKqbaQZk/images/visualizations/treemap-chart/treemap-two-dims.png?fit=max\&auto=format\&n=6PKvTpisKKqbaQZk\&q=85\&s=1f75b4f27761ec91c1a875b768c07c2f)

**Three or more dimensions**: The chart displays the top-level hierarchy. Users can click to drill down into deeper layers.

![A treemap rectangle being clicked, expanding to fill the chart and reveal the next level of the hierarchy](https://mintcdn.com/lightdash/6PKvTpisKKqbaQZk/images/visualizations/treemap-chart/treemap-drilldown.gif?s=fad779ba6ebe41b3dc29fb20f47aebe5)

Treemaps are useful when:

* You want to compare proportions across categories
* You're visualizing hierarchical data
* Space is limited and you want a compact alternative to bar or pie charts

To create a treemap, select **Treemap** as the chart type and choose your dimensions.

## Layout

* **Dimension hierarchy** tells Lightdash how to group or nest the dimensions.
* **Size metric** determines how large each section of the treemap chart is.
* **Color metric** allows you to set a color scale for Highlighting each section of the treemap.

## Display

* **Minimum section size** determines when to start hiding sections, anything smaller than this size can be shown by zooming in.
* **Max leaf depth** allows you to choose when a user needs to start drilling into sections to see the next tier, default value is 2.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.