# Hierarchy Chart

## Render Types

Hierarchy charts support the following render types.

| <p>Tree </p><p><picture><source srcset="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-749069606e9bdc650e215db7ce885dba9bf3159a%2Fhierarchy-tree-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-ae8afde3afc3a1adc88a7e0f22cbc1b381254e86%2Fhierarchy-tree-light.png?alt=media" alt="Hierarchy Tree"></picture></p>          | <p>Treemap </p><p><picture><source srcset="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-af85c0d96d3481966fdb736d715ddb64952d84ba%2Fhierarchy-treemap-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-41ebcd65e3cbd0e62842bc9dfa4d9db3ea0c5736%2Fhierarchy-treemap-light.png?alt=media" alt="Hierarchy Treemap"></picture></p> | <p>Sunburst </p><p><picture><source srcset="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-b941016cfb970e34a68f8a82ce7d3172f9873f09%2Fhierarchy-sunburst-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-7b39d7595523ff10338ec0c28bb7947805ab0772%2Fhierarchy-sunburst-light.png?alt=media" alt="Hierarchy Sunburst"></picture></p> |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>Bar (Drill Down) </p><p><picture><source srcset="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-0e326564409c7264c878519d2b6ae3de63af1337%2Fhierarchy-bar-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-2a7a6088bfc5ba8bdb09bb21eadd4bf4675a8986%2Fhierarchy-bar-light.png?alt=media" alt="Hierarchy Bar"></picture></p> |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

## Specifications

### Aggregation

Hierarchy charts [aggregate values (metrics) for each hierarchy level (dimensions)](https://docs.codatum.com/data-exploration/chart-common#dimension-metric) and render a hierarchy structure.

| Item      | Role      | Notes                                                                  |
| --------- | --------- | ---------------------------------------------------------------------- |
| Hierarchy | Dimension | Specify from higher to lower levels (e.g., Region → Prefecture → City) |
| Value     | Metric    | Used as weight if specified                                            |

#### Example Configurations

* Show "Sales composition by Region → Prefecture → City" as a sunburst
  * Hierarchy (Dimension): Region, Prefecture, City
  * Value (Metric): Sum of sales
* Show "Counts by organizational hierarchy" as a tree
  * Hierarchy (Dimension): Division, Section, Team
  * Value (Metric): None (aggregated by row count)

### Render Type Specifications

* Tree, Treemap, and Sunburst render the hierarchy as-is
* Bar (Drill Down) starts at the top level, and clicking a bar drills down to the next level
  * Specify two or more levels and set the render type to "Bar (Drill Down)"

## Tips

### Frame Feature

Hierarchy charts(Tree, Treemap, Sunburst) support the frame feature. See [Frame Feature](https://docs.codatum.com/data-exploration/chart-common#frame-feature) for details.
