--- title: "Tree Map" slug: "tree-map" updated: 2023-03-03T18:54:53Z published: 2023-03-03T18:54:53Z canonical: "docs.preset.io/tree-map" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.preset.io/llms.txt > Use this file to discover all available pages before exploring further. # Tree Map A **tree map** uses scaled rectangles to visualize the same metric across multiple different groups. You can add further stratify your tree map and add hierarchy using a dimensional column. Here are some examples: ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/trees.png) ### Reference Content The following articles may be useful resources as you build your chart: - [Creating a Chart](/v1/docs/creating-a-chart): A walkthrough of the overall process of chart selection and creation. - [Using Preset Chart Builder](/v1/docs/using-preset-explore): How to work with the Chart Builder page, the primary interface used when creating a chart. ## Creating a Basic Treemap Preset currently has a few options for treemaps in the visualization picker: - **Treemap v2** - Treemap We strongly recommend using the Treemap v2 visualization type, as it's newer and supports more features. ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-09-19%20at%208.30.56%20PM.png) To create a Treemap, you need to define: - the Metrics you want visualized as rectangles - the Dimension(s) you want to use for partitioning Below is a simple Treemap: ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-09-19%20at%208.06.09%20PM.png)Here's an explanation of the selections we made in the chart builder interface to generate this chart. | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-09-19%20at%208.02.21%20PM.png) | **Chart Builder options** - Like many charts in Preset, start by selecting the **Metrics** and **Dimensions** you want to visualize. Unlike the other charts in Preset, choosing a **Dimension** column is crucial to creating a useful tree map. - **Dimensions**: choose the column you want to be used for partitioning the rows and for powering the GROUP BY in the generated SQL. - **Metric**: choose the metric that's visualized as rectangles in the tree map. | | --- | --- | | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/tree_query_2.png) | **Generated Query** | ## Creating a Hierarchical Treemap You can add layers of hierarchy into your treemap by choosing multiple dimensional columns.![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-09-19%20at%208.09.40%20PM.png) Here's a breakdown of the selections we made in Chart Builder to generate the chart above. | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-09-19%20at%207.59.22%20PM.png) | **Chart Builder options** - This time, we will use two dimensional columns instead of one. A pairwise GROUP BY will be computed. | | --- | --- | | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/tree_query1(1).png) | **Generated Query** | ## Customizing your Treemap Under the **Customize** tab, you can find a number of options for customizing your tree chart further. Here are some of the options: - **Color Scheme**: choose the color palette you want used in your chart - **Labels** - **Show Labels**: checkbox that shows the metric values as labels if ticked - **Show Upper Labels**: checkbox that shows labels of parent squares in a hierarchical treemap - **Number Format**: how you want the numbers formatted for display - **Date Format**: how you want the date values formatted for display