Sunburst Chart in Tableau

While working as a sales analyst for a retail company, I have to create a data visualization to display different product categories and their subcategories, which contribute to overall sales.

Using Tableau, I created a Sunburst chart to visualize this data. In this chart, the inner ring represents the three main product categories: Furniture, Office Supplies, and Technology, each sized by its total sales contribution. The outer ring displayed the sub-categories within each main category, also sized proportionally to their sales.

In this Tableau tutorial, I will explain what a Sunburst chart is in Tableau and the methods to create a Sunburst chart in Tableau.

What is a Sunburst Chart in Tableau?

In Tableau, a Sunburst chart is used to display hierarchical data, which is represented by nested, layered data in a circular chart. Each layer represents part of a hierarchical data structure, with the innermost layer representing the top level. 

The size of each segment within a ring or layer indicates the proportion or value it represents within that level of the hierarchy.

For example, to visualize the sales hierarchy with Category > Sub-Category > Region. The innermost layer would display the three main product categories (Furniture, Office Supplies, Technology). The next layer would break each category into its subcategories, and the outermost layer would display sales distributed across different regions.

In Tableau, we don’t have a built-in option to create a Sunburst chart. To display the Sunburst chart, we need to customize and overlap the pie charts.

Create a Sunburst Chart in Tableau

In Tableau, there are two ways to create a basic Sunburst Chart.

  • Create a Sunburst chart using a dual axis in Tableau
  • Create a Sunburst chart using map layers in Tableau

Create a Sunburst Chart Using a Dual Axis Pie Chart in Tableau

To create a Sunburst chart in Tableau, we will use the Superstore data. After connecting the data source with Tableau, follow the steps below.

  1. Select the Marks type as Pie and drag the Sub-category to the Color card. After this, add the Sales to the Angle card.
Craete a Sunburst chart in Tableau
  1. In the rows shelf, create a calculatice field twice with value as MIN(0). With this we will have two pie charts that we will overlap in the further steps.
Tableau Sunburst Chart

3. Now, in the first calculative axis, drag the Subcategory to the Details card. After this, change the card type from Detail to Color.

Tableau create a Sunburst Chart

With this, in the first axis of the Subcategories will be colored following the color pallete of the Category pie chart color.

Create Sunburst chart using pie chart in Tableau
  1. Now, we will overlap the pie charts. The category will be in the centre, overlapping the subcategory pie chart. For this, adjust the sizes of pie charts from the size card and ensure that the category chart is smaller in size.
Create a custom Sunburst Chart in Tableau
  1. To overlap the charts and display them as a Sunburst chart, click on the second axis (Category) in the rows and select Dual axis.
Create a Sunburst chart in Tableau

Now, you will see the Category at the center and Subcategory in the outer ring. Here, each product category and subcategory will be in alignment in inner and outer rings of the chart.

  1. At last, to display the sales values, add the Sales measures to the Label card of Subcategory Marks section.
Tableau Sunburst Chart Axis

This way, we can create a Sunburst chart in Tableau using the dual-axis pie chart.

Check out: Tableau Dual Axis Chart

Create a Sunburst Chart Using Map Layers in Tableau

Another way to create a Subburst chart in Tableau is by using the Map layers. In the Map layers, we can also add an inner and outer ring to the category and subcategory using the calculative field.

Follow the steps below to create a Sunburst chart using Map layers in Tableau.

  1. Create a calculative field with formula MAKEPOINT(0,0), label it as Position, and click OK.
Create Sunburst chart with inner circle
  1. In the data fields, double-click on the calculated field Position, and then it will be added to the Rows and Columns as Latitude and Longitude.
Tableau Sunburst Chart with Inner Circle
  1. After this, set the Marks type to ‘pie’, then add ‘Category‘ to ‘Color‘, and ‘Sales‘ to ‘Angle‘.
Create Sunburst Chart in Tableau using Map Layers
  1. Drag the calculated field ‘Position‘ to the map on Add a Marks Layer. This will create two layers in the Marks section. The existing one will be Position, and the new marks layer will be Position(2).
Sunburst chart in Tableau using Map layers

Here, rename the Position as Category and Position(2) as Sub Category.

Use Map Layers to create Sunburst Chart in Tableau

Check out: Tableau Gauge Chart

  1. In the second layer, Subcategory, change the Marks type to Pie. Next, add ‘Category‘ to the Color card and ‘Sales‘ to the Angle card.
Create Sunburst Chart in Tableau
  1. In the Sub-Category marks, we also need to add color for sub-categories, but we can’t add Sub-category to the color card. For this, first add the Sub-category to the Detail card, then change it to Color.
Two layer Sunburst Chart in Tableau

With this, the secondary color palette Sub-Category will follow the primary color palette of Category.

Add Color to Sunburst Chart in Tableau
  1. To make the overlapped pie charts visible, we need to increase the size. For that, go to the Marks section and, in the Size card, adjust the slider to increase the size. Repeat this step for both mark layers.
Adjust Size of Sunburst chart in Tableau

Now, can see that the two-layered sunburst chart is created where the color palette of Category is followed by the Sub-Category.

Check out: Donut Chart in Tableau

  1. To add a circle ring between layer one (Category) and layer two (Sub-Category), create a calculative field.

Label the field as Empty, and the value for the field will be ‘Empty’.

Circular ring in Tableau Sunburst Chart
  1. Add the calculative field ‘Position’ to the Marks Layer to create another layer that will be displayed as a white ring. After this change, label the new layer as Outer Ring.
Create Tableau Sunburst Chart using Pie Chart
  1. In the Outer Ring layer’s Marks section, select the type as Pie Chart, and add a calculative field “Empty” to the Color card. In the Color, select the white color to make the ring visible.
Sunburst Chart with a Circular ring in Tableau
  1. Here, we want the circular ring between layer one (Category) and layer two (Sub-Category); for that, drag the Outer Ring marks between Category and Sub-Category.
Create Tableau Sunburst Chart

With this, a circular ring will be added between the inner and outer layer.

  1. To add an inner circle, follow the same process as we have done for the outer circle.

Drag the Position field to the Map layer > Label it as ‘Inner Circle‘ > Set chart type to pie> Add ‘Empty‘ field to the Color card.

After this, adjust the slider from Size to increase the circle’s size.

Create a Two Layer Sunburst Chart in Tableau

Check out: Sankey Chart in Tableau

  1. To increase the Size of the Sunburst chart, press “Ctrl + Shift + B”.

To remove the map from the background, click on the Maps tab and select Background Maps > None.

Tableau Sunburst Chart with outer ring

To remove the Latitude and Longitude grid lines, right click on the chart and select Format. In the Format tab, click on the Lines icon, then select all Lines as None.

Remove maps from sunburst chart in Tableau

This way, we can create a Sumburst Chart in Tableau using the Map layers, where we can add an inner circle and a ring between two layers.

Conclusion

In this Tableau tutorial, we have learned how to create a Sunburst chart in Tableau to visualize data with hierarchy in sales data, such as Category and Sub-Category. Since Tableau doesn’t have a built-in Sunburst chart option, we discussed two methods for this chart: using dual-axis pie charts and using map layers.

The dual-axis approach involves overlapping two pie charts to represent inner and outer rings, while the map layers method consists of adding inner circles and separator rings between layers.

You may like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.