---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - en/visualization-ref/tree-chart
  - ru/visualization-ref/tree-chart
  - href: en/visualization-ref/tree-chart.md
    type: text/markdown
    title: Markdown version
csp:
  - script-src:
      - https://mc.yandex.ru
    img-src:
      - https://mc.yandex.ru
    connect-src:
      - https://mc.yandex.ru
      - wss://mc.yandex.ru
    child-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-ancestors:
      - 'blob:'
      - https://mc.yandex.ru
canonical: en/visualization-ref/tree-chart.html
title: Tree chart in DataLens On-premises
description: >-
  In this tutorial, you will learn how to create and customize the tree chart
  visualization type in DataLens On-premises.
vcsPath: en/visualization-ref/tree-chart.md
---

# Tree chart <!-- diplodoc:svg ![](../_assets/datalens/treemap.svg) --><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" aria-hidden="true" class="yc-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#1A82E3" d="M5 5h8v9H5zm9 0h5v9h-5zM5 15h5v4H5v-4Zm6 0h5v4h-5v-4Z"/><path fill="#FF0400" d="M17 15h2v4h-2v-4Z"/></svg></svg> in DataLens On-premises

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 DataLens On-premises](../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:


<!-- source: en/_includes/datalens/operations/datalens-workbooks-collections-note-step4.md -->
{% 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.


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

Follow the guide from step 4.

{% endnote %}
<!-- endsource: en/_includes/datalens/operations/datalens-workbooks-collections-note-step4.md -->


1. <!-- source: en/_includes/datalens/visualization-ref/create-1.md -->
   Go to the DataLens home page.
   <!-- endsource: en/_includes/datalens/visualization-ref/create-1.md -->
1. <!-- source: en/_includes/datalens/visualization-ref/create-2.md -->
   In the left-hand panel, select <!-- diplodoc:svg ![chart](../_assets/console-icons/chart-column.svg) --><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><g clip-path="url(#svg-6tx83g7x__a)"><path fill="currentColor" fill-rule="evenodd" d="M11.5 3.5h2a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5m-2.5 9a.5.5 0 0 0 .5-.5V7a.5.5 0 0 0-.5-.5H7a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 .5.5zm-4.5 0A.5.5 0 0 0 5 12v-2a.5.5 0 0 0-.5-.5h-2a.5.5 0 0 0-.5.5v2a.5.5 0 0 0 .5.5zm-1 1.5h-1a2 2 0 0 1-2-2v-2a2 2 0 0 1 2-2h2q.26 0 .5.063V7a2 2 0 0 1 2-2h2q.26 0 .5.063V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2z" clip-rule="evenodd"/></g><defs><clipPath id="svg-6tx83g7x__a"><path fill="currentColor" d="M0 0h16v16H0z"/></clipPath></defs></svg> **Charts**.
   <!-- endsource: en/_includes/datalens/visualization-ref/create-2.md -->
1. <!-- source: en/_includes/datalens/visualization-ref/create-3.md -->
   Click **Create chart** → **Chart**.
   <!-- endsource: en/_includes/datalens/visualization-ref/create-3.md -->
1. <!-- source: en/_includes/datalens/visualization-ref/create-4.md -->
   At the top left, click <!-- diplodoc:svg ![image](../_assets/console-icons/circles-intersection.svg) --><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M6.576 11.854a4 4 0 1 1 0-7.707A5.48 5.48 0 0 0 5 8c0 1.5.601 2.861 1.576 3.854M8 12.9a5.5 5.5 0 1 1 0-9.8 5.5 5.5 0 1 1 0 9.8m1.424-8.754A4.003 4.003 0 0 1 14.5 8a4 4 0 0 1-5.076 3.854A5.48 5.48 0 0 0 11 8c0-1.5-.601-2.861-1.576-3.854M8 4.877C8.914 5.61 9.5 6.737 9.5 8s-.586 2.39-1.5 3.123A4 4 0 0 1 6.5 8c0-1.263.586-2.39 1.5-3.123" clip-rule="evenodd"/></svg> **Select dataset** and specify the dataset to visualize. If you do not have a dataset, [create one](../dataset/create-dataset.md#create).
   <!-- endsource: en/_includes/datalens/visualization-ref/create-4.md -->
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.

<!-- source: en/_includes/datalens/visualization-ref/see-also-sub.md -->
#### Useful links {#see-also}

* [Creating a dashboard in DataLens On-premises](../operations/dashboard/create.md)
* [Adding a chart to a dashboard in DataLens On-premises](../operations/dashboard/add-chart.md)
* [Adding a selector to a dashboard in DataLens On-premises](../operations/dashboard/add-selector.md)
<!-- endsource: en/_includes/datalens/visualization-ref/see-also-sub.md -->