Are you looking to spice up your Tableau dashboards? Maybe you are bored of making the same old bar or line charts. Why not try creating a radial bar chart? Also known as a radial histogram or a circular barplot, this chart can be the centrepiece of a visualisation to grab the audience’s attention. In this blog, I will show how you can easily build one for yourself.
Get your dataset
Today is the day the Tokyo 2020 Olympic Games would have commenced, if not for a certain global pandemic. For this reason, I will use the Summer Olympics Medalist Dataset to demonstrate building a radial bar chart in Tableau. You can find this dataset in the Sample Data section on Tableau Public Resources. I have selected to use the ‘TEAM EVENTS FIXED, ALL YRS TOTA’ sheet within the data source. This particular sheet contains the total medal tally of the participating nations of all Summer Olympic Games in modern history up until 2008, without duplicating for team events.
Steps to create a radial bar chart
Step 1: To begin, union the data onto itself.
Step 2: Then, create a calculated field called ‘Path’ which distinguishes between the original data and its unioned copy. You can do this with an IIF statement using the original table name.
Step 3: Go to a worksheet and convert the ‘Path’ calculated field to a Dimension.
Step 4: Create two parameters called ‘Inner’ and ‘Outer’. And then, edit their current values to 0.5 and 1 respectively.
Step 5: Create a calculated field called ‘Field’ and use the measure that you want to show in your radial bar chart.
Step 6: The radial bar chart requires the use of Tableau’s mathematical functions in multiple calculations. Input the following calculations into separate calculated fields.
Feel free to copy them directly from here. Follow my naming convention to ensure that each calculation will function as intended.
NAME: Angle
CALCULATION: (INDEX()-1) * (1/WINDOW_COUNT(COUNT([Field]))) * 2 * PI()
NAME: Length
CALCULATION: [Inner] + IIF(ATTR([Path]) = 0, 0, SUM([Field])/WINDOW_MAX(SUM([Field])) * ([Outer]-[Inner]))
NAME: X
CALCULATION: [Length] * SIN([Angle])
NAME: Y
CALCULATION: [Length] * COS([Angle])
Step 7: After you have all the calculations, change the mark type of your worksheet to Line.
Step 8: Drag the ‘Path’ calculation onto the Path option in the Marks card.
Step 9: Bring the ‘X’ calculation onto the Columns shelf and the ‘Y’ calculation onto the Rows shelf.
Step 10: Next, choose the dimension that you want each bar in your radial bar chart to represent and drag it onto Detail in the Marks card.
Step 11: Right click the ‘X’ calculation on the Columns shelf and select your dimension in the options within Compute Using. Repeat this step for the ‘Y’ calculation on the Rows shelf.
Step 12: In your chart view, right click the ‘X’ axis and select Edit Axis. Change the range to Fixed, starting at -1 and ending at 1. Do the same for the ‘Y’ axis.
Step 13: Clean up the chart by hiding the column and row headers, and removing Grid Lines and Zero Lines.
Done!
There you have it, the radial bar chart in Tableau. You may decide to customise the chart with labels and colours. You can also change the length of the bars in the chart by modifying the ‘Inner’ and ‘Outer’ parameter values as they represent the inner and outer radius size of your radial bar chart. My example is shown below.
The radial bar chart is most effective when you have a dimension with many unique values and a measure with a decent range of values. In a dashboard, it is recommended to link this chart with other charts using Dashboard Actions to create a functional and appealing visualisation.