# Treemap Charts

### **Chart setup to build a treemap chart**

{% stepper %}
{% step %}

#### Axis

Drag the dimension to plot on the axis (e.g., Sub Category).
{% endstep %}

{% step %}

#### **Values parameter**

Drag the measures to analyze (e.g., Actuals, Plan).
{% endstep %}

{% step %}

#### **Chart type**

Select **Treemap** from the Hierarchy section of the  Chart Type dropdown menu.
{% endstep %}
{% endstepper %}

> Treemap charts visually represent the proportions of different categories as nested rectangles and are ideal for hierarchical data. Explicit measure configuration is not required.&#x20;

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FRWRsnhaKS8CQK2PubA6l%2Fimage.png?alt=media&#x26;token=6a0fce7a-5005-460d-bdb9-fbe7fee91486" alt=""><figcaption><p>Treemap chart</p></figcaption></figure>

### **1. Drill down for treemap charts**

You can add more than one dimension to the Axis parameter and group categories to create a hierarchy. You can then drill down to view the chart at a higher granularity.

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FDLxSlyflgAiE6oesaMLl%2Fimage.png?alt=media&#x26;token=9775d00b-34fd-486d-b610-51c43d1787c2" alt=""><figcaption><p>Sub category level</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FpnBMrMXvvF4pqPTcWTN6%2F2024-05-15_16h58_44.png?alt=media&#x26;token=d1500d6e-b06f-44ab-b98a-53855b0bd7af" alt=""><figcaption><p>Sub category + Sub region level</p></figcaption></figure></div>

### **2. Customization and formatting under Canvas settings**&#x20;

#### 2.1. Tile

You can choose from a range of built-in tile layouts.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FzhWXoJNOCzjcjBKum0id%2FUntitled%20Project.gif?alt=media&#x26;token=20a7d54f-f49a-4833-9976-1e973523a55a" alt=""><figcaption><p>Treemap tile layouts</p></figcaption></figure>

#### 2.2. Expand all level

This option is applicable only when there is more than one axis dimension. When this option is enabled, clicking the individual drill-down icon will drill display all the categories in the next lower level of the hierarchy.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FJu4cO3PwMOJm5nKnE3gd%2Fimage.png?alt=media&#x26;token=67fb7d73-cefb-449d-82fc-bac3aa351fde" alt=""><figcaption><p>Expand all level option</p></figcaption></figure>

In the gifs below, notice how the treemap is rendered for all the Subregions across all Subcategories when **Expand all levels** is enabled. When this option is disabled, the treemap is rendered for the specific category on which we perform individual drill-down i.e. when we click the individual drill-down icon for Mineral water, the treemap is rendered for Mineral water only.

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F5J0Qb8USGwxDHh4bCL6H%2FUntitled%20Project.gif?alt=media&#x26;token=1c58ef99-3f69-4e2e-8fea-4fec636078de" alt=""><figcaption><p>Drill down and roll up with Expand all level enabled</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FeirBHqHxsPIOeiatKHQ2%2Fexpand%20all%20disabled.gif?alt=media&#x26;token=f16170a4-9460-4598-99c3-1de95dcf6c45" alt=""><figcaption><p>Drill down for a specific category with Expand all disabled</p></figcaption></figure></div>

#### 2.3. Measure grouping

When you render multiple measures in a treemap, you can segregate the measures into separate category groups by enabling the **Measure grouping** option.

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2Fac1pS39Q1HOHH2IAySR2%2Fimage.png?alt=media&#x26;token=13a41d8e-4033-4e66-9149-f6165edaa6f5" alt=""><figcaption><p>Treemap with measure grouping enabled</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FHOM0bUjIDxnI7TkP2sTI%2F2024-05-15_17h46_37.png?alt=media&#x26;token=5cff3706-6998-4209-92c4-2e9abe1ca507" alt=""><figcaption><p>Treemap with measure grouping disabled</p></figcaption></figure></div>

When measure grouping is enabled, additional options are available to customize the header.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F9aLcWMJnrXe4x1uFFw1H%2Fimage.png?alt=media&#x26;token=c1f1e53a-cc76-4f93-8806-7ddd77df87c1" alt=""><figcaption><p>Header customizations</p></figcaption></figure>

#### 2.5. Inner padding

You can regulate the padding between the measures for a particular category.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2Fmmcn4mFtVdJTfaLJ9YV5%2Fimage.png?alt=media&#x26;token=e4b3f8a3-1f20-43ec-ba19-5f4c09ea17b7" alt=""><figcaption><p>Inner padding</p></figcaption></figure>

#### 2.6. Outer padding

You can set the padding between different category groups.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FMLAQ3IfRE343bM0Syxmp%2Fimage.png?alt=media&#x26;token=47570084-e2f7-43b2-a594-9a5314d96578" alt=""><figcaption><p>Outer padding</p></figcaption></figure>

## Additional formatting options

Here are the other settings that help you refine your Treemap chart.

<table><thead><tr><th width="143.5">Feature</th><th>Description</th><th data-type="content-ref">Link</th></tr></thead><tbody><tr><td>Number</td><td>Configure number formatting (decimals, units)</td><td><a href="../working-with-analytics+/3.-charts/3.8.-display-settings-for-charts/charts-number-settings">charts-number-settings</a></td></tr><tr><td>Legend</td><td>Show/hide and customize the legends</td><td><a href="../working-with-analytics+/3.-charts/3.8.-display-settings-for-charts/charts-legend-settings">charts-legend-settings</a></td></tr><tr><td>Data Label</td><td>Show exact values for each data point</td><td><a href="../working-with-analytics+/3.-charts/3.6.-data-label-customizations">3.6.-data-label-customizations</a></td></tr><tr><td>Trellis</td><td>Create small multiples using category split</td><td><a href="../working-with-analytics+/6.-trellis-customizations">6.-trellis-customizations</a></td></tr><tr><td>Conditional Formatting</td><td>Apply color rules to highlight values</td><td><a href="../working-with-analytics+/9.-conditional-formatting">9.-conditional-formatting</a></td></tr><tr><td>Sorting</td><td>Sort axis order</td><td><a href="../working-with-analytics+/10.-sort-and-reorder-data/sorting-data">sorting-data</a></td></tr><tr><td>Ranking</td><td>Limit to top/bottom N categories</td><td><a href="../working-with-analytics+/11.-ranking-data-topn/ranking-for-charts">ranking-for-charts</a></td></tr></tbody></table>
