As our data source, we will use a ClickHouse® demo database with a Moscow retail chain's sales data. 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 order: ProductCategory, ProductSubcategory, ProductBrand, and ProductName.
In the bottom-right corner, click Save.
Drag your 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 the hierarchy to the chart will allow you to switch between levels of detail: ProductCategory → ProductSubcategory → ProductBrand → ProductName.