Toan Hoang

Drawing Square Radial Bar Charts in Tableau

One of the most read tutorials on Tableau Magic is my Radial Bar Chart Tutorial. As more Tableau enthusiast check out our website, we are getting more requests for a tutorial on how to draw a Squared Radial Bar Chart, so , I hope you enjoy this tutorial for creating a Squared Radial Bar Chart, and an added bonus to being able to set the starting angle.

Note: As always never choose a data visualisation type and try to fit your data into it, instead, understand your data and choose the best visualization for your data consumers.

Data

Load the following data into Tableau Desktop / Public.

CountryPathValue
United States0400
United States201400
United Kingdom0300
United Kingdom201300
France0250
France201250
Germany0220
Germany201220
Canada0120
Canada201120

Note: we need two records for each Country 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 of Data Densification.

Calculated Fields

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

Path (bin)

Distance from Center

Create the following parameter with:

Starting Degree

Create the following parameter with:

Index

INDEX()-1

TC_Value

WINDOW_MAX(MAX([Value]))

TC_Max Value

WINDOW_MAX(SUM([Value]))

TC_Percentage

[TC_Value]/[TC_Max Value]

Rank

RANK_UNIQUE([TC_Value],"asc")

X

IF [Index] <= 100 THEN
    SIN(RADIANS([Index]*2.7*[TC_Percentage]+[Starting Degree]))
    *([Rank]+[Distance from Center])
ELSE
    SIN(RADIANS((201-[Index])*2.7*[TC_Percentage]+[Starting Degree]))
    *([Rank]+[Distance from Center]+1)
END

Y

IF [Index] <= 100 THEN
    COS(RADIANS([Index]*2.7*[TC_Percentage]+[Starting Degree]))
    *([Rank]+[Distance from Center])
ELSE
    COS(RADIANS((201-[Index])*2.7*[TC_Percentage]+[Starting Degree]))
    *([Rank]+[Distance from Center]+1)
END

Let us explore X and Y a little.

So now that we have created a lot of Calculated fields, we will now put this together into a Worksheet.

Worksheet

We will now build our worksheet:

If all goes well, you should see the following:

Note: These are the moments that completely distract me while blogging and make me want to experiment with different and cool shapes.

We will edit the Table Calculations to adjust the visualisation:

If all goes well you should now see the following:

Now, adjust the cosmetics of the visualisation to ensure that we have the look and feel desired.

You should now see the following:

Normally, this is where the tutorial would be completed, but I want you to:

If all goes well your Background worksheet should look like the following:

Hopefully, you can see where we are going with this. Drag both worksheets onto a dashboard and use the Layout Pane to resize and position your worksheets so that they are exactly the same size and perfectly overlap. If all goes well you should see the following:

And boom, we are now done, adjust the parameters for extra fun. I hope you enjoyed this tutorial and if in doubt, you can download the visualisation from Tableau Public here: https://public.tableau.com/profile/toan.hoang#!/vizhome/SquareRadialBarCharts/SquareRadialBarCharts

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.

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