> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Build a treemap (Beta)

> Build treemap charts in Sigma to compare values as nested boxes within categories like products, regions, and periods.

This documentation describes one or more public beta features that are in development. Beta features are subject to quick, iterative changes; therefore the current user experience in the Sigma service can differ from the information provided in this page.

This page should not be considered official published documentation until Sigma removes this notice and the beta flag on the corresponding feature(s) in the Sigma service. For the full beta feature disclaimer, see [Beta features](/docs/sigma-product-releases#beta-features).

Treemaps display values as nested boxes sized in proportion to other values within the same category. Create treemaps to easily compare values within different product categories, regions, fiscal periods, and more.

This document describes how to add a treemap chart to a workbook or report and introduces key properties and format options to help you enhance your charts.

<iframe src="https://app.sigmacomputing.com/embed/Aqx3uWNlv7G2so7aEtWNp" width="100%" height="600px" frameborder="0" allowfullscreen />

## User requirements

The ability to create treemaps requires the following:

* To create a chart in a workbook, you must be assigned an [account type](/docs/account-type-and-license-overview) with the **Full explore** or **Create, edit, and publish workbooks** permission enabled.
* To create a chart in a report, you must be assigned an [account type](/docs/account-type-and-license-overview) with the **Create, edit, and publish reports** permission enabled.
* You must be the workbook or report owner or be granted **Can explore** or **Can edit** [access to the document](/docs/folder-and-document-permissions).

## Create a treemap

Add a treemap to a workbook or report, and configure the required properties:

1. Open a draft, custom view, or saved view of a workbook or report.

2. In the **Add element** bar, select **Chart** and then **Treemap**. The **Select source** modal opens.

3. Select a data source to use for the treemap.

   You can also use the **Chart type** dropdown field to convert an existing chart to a treemap. Sigma retains all property and format configurations shared by the initial and new type. Unshared properties and formatting are not saved or restored if you further convert the chart.

4. In the **Properties** tab of the editor panel, select **+ Add column** next to **Category** and choose an option from the **Select column** popover to define how the data is grouped into different color categories:

   * To use a column that exists in the data source, search or scroll through the **Columns** list and select the column you want to use.
   * To use a custom formula, click **+ Add new column** and, in the formula bar, enter the formula you want to use.

   ![A blank treemap chart titled New Treemap Chart, and the cursor hovering over a column named Store Region in the Select column popover, with the word Region typed in the search box](https://files.buildwithfern.com/sigma.docs.buildwithfern.com/6c008e80ea7d0f4f56a37258bfe090fac6a1d566f60e3e415e7fae2b1512471b/assets/docs-images/e80d80361ca22b97d6b1058d5551f063a688f7fa2c4693fdcbdb692c2f69ec7a-treemap-category.png)

5. (Optional) Change the truncation, data type, or format of the **Category** column by clicking the down arrow (<img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/caret.svg" alt="" />) to open the column menu and then choosing the desired option.

   |                   |                                                                               |
   | :---------------- | :---------------------------------------------------------------------------- |
   | **Truncate date** | Categorize date values by the selected interval or unit of measure.           |
   | **Transform**     | Convert the column to the selected [data type](/docs/data-types-and-formats). |
   | **Format**        | Display axis and data labels in the selected format.                          |

   Column menu items vary depending on the data type of the column. For example, **Truncate date** is only available for date columns.

6. (Optional) For **Split by**, select **+ Add column** and choose an option from the **Select column** popover to define subcategories within the main color categories. Then, configure the column's truncation, data type, and format.

   If you add a column to the **Split by** property but do not add a column to the **Category** property, the column used for **Split by** is used to define the primary categories.

7. For **Value**, select **+ Add column** and choose an option from the **Aggregate column** popover to define the measurable value:

   * To aggregate the values of an existing column in the data source, search or scroll through the **Columns** list and select the column you want to use.
   * To calculate the value with a custom formula, click **+ Add new column** and, in the formula bar, enter the formula you want to use.
   * To count the number of rows associated with each category, select **Row count**.

8. (Optional) Change the aggregation, data type, or format of the **Value** column by clicking the down arrow (<img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/caret.svg" alt="" />) to open the column menu and then choosing the desired option.

   |                   |                                                                               |
   | :---------------- | :---------------------------------------------------------------------------- |
   | **Set aggregate** | Measure the metric based on the selected aggregation method.                  |
   | **Transform**     | Convert the column to the selected [data type](/docs/data-types-and-formats). |
   | **Format**        | Display axis and data labels in the selected format.                          |

   This visualization supports up to 25,000 data points. If the configurations result in a data set that exceeds this limit, the visualization displays the first 25,000 data points, and a warning message indicates that the chart is incomplete. To reduce the number of data points, aggregate the values or apply data filters to the visualization or source element.

9. (Optional) Add additional columns or calculations to the **Value** property and configure their aggregation, data type, and format to compare additional values within your defined categories and subcategories.

## Customize a treemap

You can also customize a treemap's appearance by changing its colors, layout, and spacing, in addition to using many of the formatting options available for charts. See [Additional formatting options for treemaps](#additional-formatting-options-for-treemaps) for a list of the general chart formatting options available for treemaps.

### Configure colors for a treemap

You can change the colors used to distinguish the categories defined by the **Category** property of your treemap. By default, treemaps use the default categorical colors configured for the theme of your workbook or report.

You can also configure a custom color scale for your treemap. For more information, see [Add a custom color scale](/docs/add-a-custom-color-scale).

1. Select the treemap you want to modify.
2. In the editor panel, select the **Properties** tab, and then click **Color**.
3. Select the color palette dropdown to open the popover. You can choose a default color palette or configure a custom one:

   * To use a default color palette, select **Palette** and then select one of the configured palettes for your workbook or report's theme.
   * To configure a custom color palette, select **Custom** and then click the color swatch for the individual color you want to customize or click **Add color** to add a new color to the palette. Use the color picker, enter a hex code, or choose from one of your theme's standard colors.

   ![The color picker popover, with the cursor hovering over a light purple color with hex code B07AA1.](https://files.buildwithfern.com/sigma.docs.buildwithfern.com/9647b901ccd806fac714958e25ca21d5d0b5a4644f9cce192521abad15287057/assets/docs-images/8e7e7889a0f34ed79e0caa7f6b492612f31752148beef78b484e30abcdee3fa8-colorpicker-treemap3.png)

### Change the layout of a treemap

You can modify how the dimensions of rectangles in a treemap are calculated by changing the layout method. By default, treemaps use the **Squarify** method.

1. Select the treemap you want to modify.
2. In the **Format** tab of the editor panel, select **Layout** to expand the section.
3. For **Method**, choose the desired layout method from the dropdown:

   |                    |                                                                                                              |
   | :----------------- | :----------------------------------------------------------------------------------------------------------- |
   | **Squarify**       | Format the chart's rectangles into approximately uniform aspect ratios.                                      |
   | **Slice and dice** | Format the chart's rectangles into vertical partitions by category and horizontal partitions by subcategory. |
   | **Binary**         | Format the chart's rectangles into a balanced binary tree of either tall or wide rectangles.                 |

### Customize spacing for a treemap

You can change the spacing between categories as well as individual rectangles in a treemap to modify how categories and subcategories are separated visually.

1. Select the treemap you want to modify.
2. In the **Format** tab of the editor panel, select **Layout** to expand the section.
3. Configure the spacing of the treemap:

   * To customize the spacing between each individual rectangle, adjust the **Node spacing** slider.

   ![A treemap chart titled "Revenue by Store Region and Product Type" with the Node spacing slider set to 8.](https://files.buildwithfern.com/sigma.docs.buildwithfern.com/e413fb05cd1b435340bcb8aefd9ce4b89fdb57a99411421e805c34ada35ab764/assets/docs-images/a9799143a1200015a2b21a26b5c8eaf83fb4210e34c10ae244f30b39c8fae485-treemap-nodespacing.png)

   * To customize the spacing between color categories, adjust the **Group spacing** slider.

   ![A treemap chart titled "Revenue by Store Region and Product Type" with the Group spacing slider set to 8.](https://files.buildwithfern.com/sigma.docs.buildwithfern.com/55d14addf0e0cdb441c1cad10ff9b07c4fb5959a4885440a763141af1c56ddc4/assets/docs-images/c1bb143408840b6e04a6b77c73b8fa3ebe5d301dd92e213c1681fa311886b16a-treemap-groupspacing.png)

   If you do not have columns configured for both **Category** and **Split by**, the **Group spacing** slider is not available.

### Additional formatting options for treemaps

Treemaps also support the following chart formatting and customization options:

* [Element style](/docs/customize-chart-background-and-style)
* [Title](/docs/customize-element-title)
* [Legend](/docs/format-chart-legend)
* [Tooltip](/docs/customize-chart-mark-tooltip-fields)

## Related resources

* [Intro to charts](/docs/intro-to-visualizations)
* [Create a data element](/docs/create-a-data-element)