The other dimensions define the grouping of the rectangles. The last dimension you add defines the rectangles.
![anychart treemap headers anychart treemap headers](https://preview.anychart.com/pg/docs-v8-samples-bct-treemap-chart-09.png)
Add more dimensions in the order of hierarchy level.The measure will define the size of a rectangle. Click Add measure and select a measure or create a measure from a field.
![anychart treemap headers anychart treemap headers](https://www.anychart.com/_design/img/static/features/exports-and-sharing-2.png)
It will be displayed as the main group in the chart. This should be the highest level in the hierarchy. Click Add dimension and select a dimension or a field.From the assets panel, drag an empty treemap to the sheet.You can create a treemap on the sheet you are editing. Negative values cannot be displayed in treemaps. Nor is a treemap the right choice when mixing absolute and relative values. Treemaps are not good when there is a big difference in the magnitude of the measure values. When there is a correlation between color and size in the tree structure, you are able to see patterns that would be difficult to spot in other ways, for example, when a certain color is particularly relevant. Treemaps are economical in that they can be used within a limited space and yet display a large number of items simultaneously. Treemaps should primarily be used with values that can be aggregated. Use a treemap when space is constrained and you have a large amount of hierarchical data that you need to get an overview of. If the data set contains negative values, a text message is shown stating that the negative values cannot be displayed. The darker the color, the higher the average margin. In this example, the coloring is not by dimension, but by expression ( Avg(Margin)), a calculated measure, and by using this expression, you can see which items have the highest average margin. When you have more than one dimension, you can decide which dimension to color by. By default, the coloring is by dimension, with 12 colors, but that can be changed in the properties panel. The leaf nodes are colored to show a separate dimension of the data. In this example, the items Ebony Squash, Bravo Large Canned Shrimp, Red Spade Pimento Loaf, and so on, are the leaves. A leaf node's rectangle has an area proportional to a specified dimension of the data. You can regard the product types as sub-branches of the tree. When you select a product group, you drill down to the next level, the product type, for example, Vegetables, Meat, and Dairy. You can regard the product groups as branches of the tree. Each product group consists of a large rectangle.
![anychart treemap headers anychart treemap headers](http://cdn.anychart.com/images/qlik-screens/legend_2.jpg)
In this image you have several product groups, such as Produce, Canned Products, and Frozen Foods. Treemaps display hierarchical data by using nested rectangles, that is, smaller rectangles within a larger rectangle.