[Yandex Cloud documentation](../../index.md) > [Yandex DataLens](../index.md) > Charts > [Visualization reference](index.md) > Tree chart

# Tree chart ![](../../_assets/datalens/treemap.svg) in Yandex DataLens

A tree chart displays hierarchy data as a set of nested rectangles. 

* Each hierarchy level corresponds to a dimension and is shown as a colored rectangle with nested rectangles.

* The size of the rectangle directly depends on the value of the measure. A chart does not take up much space on a dashboard, even if it contains a lot of data.

{% cut "Example" %}

Sales with a breakdown by product category and subcategory.

{% list tabs %}

- Visualization

    ![tree-chart](../../_assets/datalens/visualization-ref/tree-chart/tree-chart.png)

- Source table

    | Category        | Subcategory         | Sales  |
    |------------------|----------------------|----------|
    | Home appliances | Kitchenware             | 15,000,000 |
    | Home appliances | Beauty and health products   | 17,000,000 |
    | Household goods   | Kitchen products      | 12,000,000 |
    | Household goods   | Essential goods | 8,000,000  |
    | Household cleaners    | Detergents      | 4,100,000  |
    | Household cleaners    | Cleaners    | 3,300,000  |

{% endlist %}

{% endcut %}


## Wizard sections {#wizard-sections}

Wizard<br/> section| Description
----- | ----
Dimensions | Dimensions. Determines the hierarchy tree of nested rectangles. For `String` type fields, you can configure using basic [Markdown in Yandex DataLens](../dashboard/markdown.md) syntax: click the icon before the field name and enable **Markdown**.
Size | Measure. One measure that determines the area of a rectangle.
Colors | Dimension or measure. Affects the shading of rectangles in a chart.
Filters | Dimension or measure. Used as a filter.

## Creating a tree chart {#create-diagram}

To create a tree chart:


{% note warning %}

If you use the new DataLens object model with [workbooks and collections](../workbooks-collections/index.md):


1. Go to the DataLens [home page](https://datalens.ru/?skipPromo=true). In the left-hand panel, select ![collections](../../_assets/console-icons/rectangles-4.svg) **Collections and workbooks**.


1. Open the workbook, click **Create** in the top-right corner, and select the object you need.

Follow the guide from step 4.

{% endnote %}


1. Go to the DataLens [home page](https://datalens.ru/?skipPromo=true).
1. In the left-hand panel, select ![chart](../../_assets/console-icons/chart-column.svg) **Charts**.
1. Click **Create chart** → **Chart**.
1. At the top left, click ![image](../../_assets/console-icons/circles-intersection.svg) **Select dataset** and specify the dataset to visualize. If you do not have a dataset, [create one](../dataset/create-dataset.md#create).
1. Select **Tree chart** as the chart type.
1. Drag one or more dimensions from the dataset to the **Dimensions** section.
1. Drag a measure from the dataset to the **Size** section. 
    The values will be displayed as rectangles. The areas of the rectangles are proportional to the corresponding values of the selected measure.
1. Drag a measure or dimension from the **Dimensions** section to the **Color** section.
    As a result, the rectangles will be colored depending on the value of the added measure or dimension. A dimension that you can add to the **Color** section must be from the **Dimensions **section.
1. Drag a dimension or measure from the dataset to the **Filters** section.
    The field can be empty. In this case, no filters are applied.

## Recommendations {#recommendations}

* Use this type of chart to show the relationship between a part and a whole.
* If there are few categories (up to six), use a pie or donut chart.
* You cannot display negative values on a tree chart.

#### Useful links {#see-also}

* [Creating a dashboard in Yandex DataLens](../operations/dashboard/create.md)
* [Adding a chart to a dashboard in Yandex DataLens](../operations/dashboard/add-chart.md)
* [Adding a selector to a dashboard in Yandex DataLens](../operations/dashboard/add-selector.md)