We will use a Moscow retail chain's demo ClickHouse® sales database as our data source. For an example of creating a connection and dataset, see this guide.
In the top-right corner of the dataset, click Create chart.
Select the Donut chart visualization type.
Add a sales measure to the chart. To do this, drag the Sales field from Measures to the Measures section.
On the left side of the screen above the list of dataset fields, click and select Hierarchy.
Enter Products as the hierarchy name and select the dimensions in the following sequence: ProductCategory, ProductSubcategory, ProductBrand, and ProductName.
In the bottom-right corner, click Save.
Drag the created hierarchy to the Color section.
Save the chart:
In the top-right corner, click Save.
In the window that opens, enter Donut chart with hierarchy as the chart name and click Save.
Adding a hierarchy to the chart will allow you to switch between levels of detail: ProductCategory → ProductSubcategory → ProductBrand → ProductName.
You can see some examples of charts with a hierarchy on a ready-made dashboad.