Many Tableau users have viewed, downloaded and attempted to mimic the Sunburst chart by **Bora Beran**. Bora’s blog can be found **HERE **and within is the link to the workbook on Tableau Public. Most people I know (including myself) have faced trouble replicating this with their own data and getting their heads around the use of Paths, Bins, Window Calculations and the sheer complexity of it.

In this blog I will try my best to explain these concepts and hopefully give you some light on how this all works. Through this tutorial we are going to try and draw the well known and loved Wifi sign and only using 6 rows of data.

*Note: This blog was written at the request of Rajeev Pandey @rajvivan. If you have any things you want me to blog about please get in touch. I am always looking for ideas.*

## The Data

The following data sets looks like the following. Copy this into Excel and then copy and paste this into Tableau.

## Path, Bins and Table Calculations

We will need more points in order to draw out our shapes so therefore will use Bins to do so.

Right Click on the **Path**, select **Create…** and then **Bins…**

In the **Create Bins [Path]** dialogue box

- Leave the New field name as
**Path (bin)** - set the
**Size of the bins**to**1** - Click
**Ok**

Let us explore this new object by:

- Dragging
**Path (bin)**onto the**Rows**. **Right click**on the**Path (bin)**and select**show missing values**- This is a critical step

**Category**onto**Columns****Level**onto the**Text Mark**

You should see that the following:

You will notice that there is only a **Level** where **Path (bin)** is **1** or **182**. This is because there is only data at these points and no data else where. From here we need to use Table Calculations which will be usable even though there is no data. Confused? Lets create our first Table Calculation:

**Right Click** on the **Dimensions** panel and choose **Create Calculated Field…**

- Call this Calculated field
**Index** - In the content type
**INDEX() – 1**- We use Index() – 1 because we want to start at 0 whereas Index() will start at 1.

- Click
**Ok** - Replace the
**SUM(Level)**with the**Index**calculated field.

As Table calculations are available to all Dimensions you should now see a fully populated table. Cool huh.

Yes, **Index** is a very useful Table Calculation and has many many applications.

We will now create a few more Table Calculations that will be used later in this tutorial.

**Right Click** on the **Dimensions** panel and choose **Create Calculated Field…**

- Call this Calculated field
**PI** - In the content type
**WINDOW_MAX( MAX( PI() ) )** - Click
**Ok**

**Right Click** on the **Dimensions** panel and choose **Create Calculated Field…**

- Call this Calculated field
**Starting Point**

- Click
**Ok**

**Right Click** on the **Dimensions** panel and choose **Create Calculated Field…**

- Call this Calculated field
**Width** - In the content type
**WINDOW_MAX( 0.3 ) )** - Click
**Ok**

## Drawing

Now that we have our objects created we can finally start drawing. But before we do we will two objects, called X and Y:

**Right Click** on the **Dimensions** panel and choose **Create Calculated Field…**

- Call this Calculated field
**X** - In the content type
**SIN([Index]*[PI]/180)** - Click
**Ok**

**Right Click** on the **Dimensions** panel and choose **Create Calculated Field…**

- Call this Calculated field
**Y** - In the content type
**COS([Index]*[PI]/180)** - Click
**Ok**

*NOTE: The Index Calculated field will following the values in the Path (Bin) and give us our degrees. We have to turn Degrees into Radians by multiply PI and dividing by 180.*

In a fresh sheet drag:

**X**into**Columns****Y**into**Rows****Path (Bin)**into the**Detail**Mark**Right Click**on the**X**pill in the shelf- Go to
**Compute using** - Choose
**Path (Bin)** **Right Click**on the**Y**pill in the shelf- Go to
**Compute using** - Choose
**Path (Bin)**

You should now see the following:

Lets fully digest what we have just achieved.

- The
**X**and**Y**Calculated Fields are using**Index**in their formulas - For
**X**and**Y**we set Compute using**Path (bin)**which means the index field will take into account the**Path (bin)**which contains 182 points.

We are now now going to move on by:

- Change
**X**to be**SIN([Index]*[PI]/180) * [Starting Point]** - Change
**Y**to be**COS([Index]*[PI]/180) * [Starting Point]** - Drag
**Category**onto the**Detail**Mark- Do not worry if the visualisation goes blank

- We will fix the visualisation by repeat a previous step
**Right Click**on the**X**pill in the shelf- Go to
**Compute using** - Choose
**Path (Bin)** **Right Click**on the**Y**pill in the shelf- Go to
**Compute using** - Choose
**Path (Bin)**

- This is required as we have a new Table Calculation and hence need to tell Tableau how we want it treated.

We should now get the following:

As you can see the starting point tells Tableau where we want our lines to start.

Now we only want 90 degrees and we want to bend the shape around. As such we are going to change X and Y to:

What we are doing here is making sure that when we have gone to **90 Degrees** add some **Width** and go backwards. Again we will have to fix our **Compute Using**:

**Right Click**on the**X**pill in the shelf- Go to
**Compute using** - Choose
**Path (Bin)** **Right Click**on the**Y**pill in the shelf- Go to
**Compute using** - Choose
**Path (Bin)**

We should now have the following:

Now that you can see the shape we have a few more steps to do:

- In the
**Marks**Panel select**Polygon** - Draw the
**Path (bin)**onto**Path**

And here it is:

Now if we apply a little formatting we can get the following:

## Summary

To recap on the things we had to do to create this visualisation we had to use:

- Create two records for each item and distinguish them with a different
**Path**value - Use the
**Path**value to create a**Bin**object - With Bin Objects we can select
**show missing values**which will fill in the values in Bin Object. - If we are to use the missing values we must
**only**use Table Calculations. As such we created several to represent**Index, PI**,**Width**and**Starting Point** - We then create an
**X**and**Y**object which is based on our Table Calculations- Index is especially important here

- We then use our data to drag a
**Polygon**and use the**Path (Bin)**object to dictate the path.

I hope that this tutorial has helped you understand how to potentially draw objects using Tableau. One last thing that I would like to mention is if your **Calculated field** makes use of several Table Calculations you can have different Compute using for each objects. That is where things can really get messy but explore and do not be afraid.

When trying to replicate Bora’s example make sue you check the Compute Using for each of the Table Calculations used as this is where a lot of people struggle.

Hi Toan,

The tutorial is really great and easy to go. Enjoyed your detailed description .While reading /implementing the same , I have noticed something and wanted to highlight the same.

1) If we take Index()-1 then all the Values in Column A should appear as 0 but the diagram is showing 1 as its value. Index() will do the magic.But Index()-1 is also required when we create a final X and Y coordinates because if we use Index then we will not able to see a smooth polynomial curve at the end where the starting points are 0.6 and 1.0.

2) The First diagram which is showing under Heading “Drawing” is misleading because till that point we haven’t multiplied Starting Point

with “X” and “Y” Coordinates .All the categories will appear on top of another and user will not able to distinguish unless user add category on color marks and do the Highlighting So we will not see the 3 different Semi -circle

Thanks for the comments Rajeev, I have added a note for point 1 to explain the Index() – 1. With regards to point two, that was quick blogging at work and I have removed the image.

May i know what states “Level1 & Level2” on Starting point Calculation filed please ?

Hi Savitha,

Level is a field in the data source and allows us to set a starting point for each of the rings. If you want to make this dynamic you can use rankings or other forms.