Tree Map
  • 03 Mar 2023
  • 1 Minute to read
  • Dark
    Light

Tree Map

  • Dark
    Light

Article Summary

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:

Reference Content

The following articles may be useful resources as you build your 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.

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:

Here's an explanation of the selections we made in the chart builder interface to generate this chart.

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. 
Generated Query

Creating a Hierarchical Treemap

You can add layers of hierarchy into your treemap by choosing multiple dimensional columns.

Here's a breakdown of the selections we made in Chart Builder to generate the chart above.

Chart Builder options
  • This time, we will use two dimensional columns instead of one. A pairwise GROUP BY will be computed.
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

Was this article helpful?

What's Next