Petal Charts in Tableau

Author: Firoj Kumar Patnaik


A custom chart is one of the ways to visualize your data as charts that are not present by default inside the showme section of the Tableau. Unlike traditional charts, this is a powerful approach to analyzing business-critical data. We need to keep in mind that if you want to visualize your data, make sure to use the right charts. Even though your data works with multiple chart types, selecting the one that ensures your message is clear and accurate is up to you. Remember, a chart is valuable only if the context is clear to the users.


In this post, we will learn how we can create a petal chart or radial line chart in Tableau. Let’s jump into tableau desktop and start creating it.


Data

For this example, I have taken random sample data. A screenshot of the sample is attached below.



Here we are going to use the densification technique. Two records are required for each stage to get more points on our canvas. So, let’s create another data source as per the below screenshot.



Now open the Tableau desktop and connect to both the data source and join them as per the below screenshot.



Make sure your data is looking like the screenshot below in Tableau.



Calculated Fields

Now let’s create calculated fields and bins.


From Path Create Bins

  • In Path, go to Create and Bins.

  • Inside the Edit Bins dialogue box do the followings:

  • Set the name of the field to Path (bin).

  • Set the Size of bins to 1.

  • Click Ok.


PC_Index

(INDEX()-1)


PC_Degrees

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


PC_Size

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


X

SIN([PC_Index]*[PC_Degrees]*PI()/180)*[PC_Index]*[PC_Size]


Y

COS([PC_Index]*[PC_Degrees]*PI()/180)*[PC_Index]*[PC_Size]


Visualization

Now let’s start creating our visualization.

  • First, change the Mark Type to Line.

  • Now drag the state field to the color mark.

  • Drag Path (bin) calculated field into Columns.

  • Ensure that the Show Missing Value option is checked.

  • Now drag it onto the Path Mark.

  • Now let's drag the calculated field X onto the Columns Pane.

  • Right-click on the Pill, select state by going to Compute Using.

  • Right-click on the Pill once again, select Edit Table Calculations,

  • Inside the Nested Calculations field for Index, set Compute Using option to Specific Dimensions and select Path (bin).

  • Drag the calculated field Y onto the Rows Pane.

  • Right-click on the Object, select state by going to Compute Using.

  • Right-click on the Pill once again, select Edit Table Calculations,

  • Inside the Nested Calculations field for Index, set Compute Using option to Specific Dimensions and select Path (bin).


Now our visualization will look like the screenshot below.



We will try to do aesthetic changes to make it look better.

  • Go to format and remove the grid and zero lines.

  • Fix the range of both the axis i.e. X and Y-Axis from -1 to 1 limit.

  • You can hide the headers of the axes.

  • Now bring PC_Index onto the Size mark. Right-click on the Pill then go to Compute Using, and select Path (bin). You can adjust the size now.

  • Edit tooltips according to requirement.



Now we will see a chart like screenshot below.



Conclusion

Always select the charts for your visualizations carefully and make sure the metrics are clearly and easily understandable by looking into it.

Thank you for reading the blog.


References
31 views0 comments

Recent Posts

See All