Toan Hoang

Creating Radial Stacked Bar Chart in Tableau

I saw this a while ago and thought that I would write a tutorial about creating Radial Stacked Bar Charts in Tableau; this is a Stacked Bar Chart based on Percentage of Totals but drawn in a circular shape. This was loads of fun to create, so I hope you really enjoy it.

Note: This is an alternative type of data visualisation, and sometimes pushed for by clients. Please always look at best practices for data visualisations before deploying this into production.

Data

We will start by loading the Sample Superstore data into Tableau.

Note: If you have Tableau Desktop, you can use the Sample data source, but if you are using Tableau Public, download and load the following data source.

Once your data is loaded into Tableau, right-click on the data source and click on Edit Data Source… with the Data Source Editor open, paste the following:

Path
1
202

Note: If you are using Tableau 2020.2 or great i.e. have access to new Relationship Model, you will need to double-click on the originally pasted data source to open up before pasting in the Path Data.

You should get an error as there is no joining column, however, click on Add new join clause, go to Create Join Calculation, type 1 and click OK. Do this for the right-hand side as well. Ensure that you have Inner join selected and you should see the following:

Note: we need additional records as we are going to be drawing lines and using densification to get more points on our canvas. For more information, check out our article on Data Densification.

Calculated Fields

With our data set loaded into Tableau, we are going to create the following Bin and Calculated Fields:

Path (bin)

Index

INDEX()-1

TC_Step Size

3.6/12

TC_Date Part

WINDOW_MAX(MAX(DATEPART('month', [Order Date])))-1

TC_Segment Sales

WINDOW_SUM(SUM([Sales]))/2

Note: as we are using data densification, we are going to be doubling our values, therefore, we need to divide by to get the correct values.

TC_Total Segment Sales

WINDOW_SUM(SUM([Sales]))/2

TC_Percent Segment Sales

[TC_Segment Sales]/[TC_Total Segment Sales]

TC_Starting Point

[TC_Date Part]*[TC_Step Size]*100

TC_Previous Percentage

RUNNING_SUM([TC_Percent Segment Sales])-[TC_Percent Segment Sales]

X

IF [Index] <= 100 THEN
    SIN(RADIANS(([Index]*[TC_Step Size])+[TC_Starting Point]))*(1+[TC_Previous Percentage])
ELSE
    SIN(RADIANS(((201-[Index])*[TC_Step Size])+[TC_Starting Point]))*(1+[TC_Percent Segment Sales]+[TC_Previous Percentage])
END

Y

IF [Index] <= 100 THEN
    COS(RADIANS(([Index]*[TC_Step Size])+[TC_Starting Point]))*(1+[TC_Previous Percentage])
ELSE
    COS(RADIANS(((201-[Index])*[TC_Step Size])+[TC_Starting Point]))*(1+[TC_Percent Segment Sales]+[TC_Previous Percentage])
END

With this done, let us start creating our data visualisation.

Worksheet

We will now build our first worksheet:

If all goes well, you should now see the following:

Seriously, how cool is this…!!! However, this is not exactly what we are going for, and I want us to adjust the Table Calculations.

We are going to repeat this for the Y Table Calculation:

If all goes well, you should now see the following:

Take some time to research the understand the Table Calculations. Basically:

Now, we that said, we just need to adjust the Cosmetics, and we are done.

You should now have the following:

This shows the Percentage split by Sales by Order Month by Segment and boom, we are done! I hope you enjoyed the random accidental art we saw throughout this tutorial, and as always, you can find this data visualisation on Tableau Public at https://public.tableau.com/profile/toan.hoang#!/vizhome/RadialStackedBarCharts_15709881125870/RadialStackedBarCharts

Summary

I hope you all enjoyed this article as much as I enjoyed writing it and as always do share the love. Do let me know if you experienced any issues recreating this Visualisation, and as always, please leave a comment below or reach out to me on Twitter @Tableau_Magic. Do also remember to tag me in your work if you use this tutorial.

If you like our work, do consider supporting us on Patreon, and for supporting us, we will give you early access to tutorials, exclusive videos, as well as access to current and future courses on Udemy:

Also, do be sure to check out our various courses:

Exit mobile version