I struggled to find the appropriate name for this chart type and it bugged me quite a bit. On one hand, should this be called a petal chart or should this be called a radial line chart with expanded extremities? Alas, what is in a name? right? If someone has the perfect name for this, please comment below or send me a message, but in the mean time, let us get to building this Data Visualisation in Tableau.

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.

CountriesSalesPath
United Kingdom800
0
United Kingdom8001
United States7000
United States7001
Australia5000
Australia5001
Germany9000
Germany9001
France2000
France2001
India4000
India4001
Singapore3000
Singapore3001

Note: we need two records for each stage as we are going to be drawing polygons and using densification to get more points on our canvas.

Calculated Fields

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

Path (bins)

  • Right click on Path, go to Create and select Bins…
  • In the Edit Bins dialogue window:
    • Set New field name to Path (bin).
    • Set Size of bins to 1.
    • Click Ok.

Index

(INDEX()-1)

TC_Degrees

360/WINDOW_COUNT(COUNTD([Countries]))*INDEX()

TC_Size

MAX([Sales])/WINDOW_MAX(MAX([Sales]))

X

SIN([Index]*[TC_Degrees]*PI()/180)*[Index]*[TC_Size]

Y

COS([Index]*[TC_Degrees]*PI()/180)*[Index]*[TC_Size]

Now that we have our Calculated Fields created, let us start creating our Worksheet.

Worksheet

We will now build our worksheet:

  • Change the Mark Type to Line.
  • Drag Countries to Color.
  • Drag Path (bin) onto Columns.
    • Right-click on this object and ensure that Show Missing Values is checked.
    • Drag this object onto the Path Mark.
  • Drag X onto Columns.
    • Right-click on the Object, go to Compute Using and select Countries.
    • Right-click on the Object, to Edit Table Calculations...
      • In Nested Calculations for Index, set Compute Using to Specific Dimensions and select Path (bin).
  • Drag Y onto Rows.
    • Right-click on the Object, go to Compute Using and select Countries.
    • Right-click on the Object, to Edit Table Calculations...
      • In Nested Calculations for Index, set Compute Using to Specific Dimensions and select Path (bin).

If all goes well, you should have something like the following:

Now we will adjust the cosmetics of the visualisation by:

  • Remove grid and zero lines.
  • Fix the range of the X and Y Axis to -1 and 1.
  • Hide the Axis headers.
  • Drag Index onto Size.
    • Right-click on the Object, go to Compute Using and select Path (bin).
    • Adjust size accordingly.
  • Add tool tips.

You want to end up with something like the following:

and boom, we are done and have created a quick but very cool data visualisations.

You can see and interact with my visualisation on Tableau Public at https://public.tableau.com/profile/toan.hoang#!/vizhome/PetalDiagrams/PetalDiagrams

Summary

I hope you all enjoyed this article as much as I enjoyed writing it, if so, please do share this article with fellow Tableau addicts and spread 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 want to learn more about Creating Bespoke Data Visualisations in Tableau, do check out our course on Udemy at https://www.udemy.com/creating-bespoke-data-visualisations-in-tableau and using the coupon code TMWEB2019

3 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.