top of page
hand-businesswoman-touching-hand-artificial-intelligence-meaning-technology-connection-go-

Creating a Stunning Petal Chart in Tableau: A Step-by-Step Guide

Data visualization is a powerful way to communicate insights, and Tableau is one of the best tools for creating compelling charts. In this blog post, we'll walk through the process of creating an impressive petal chart using Tableau and a simple dataset. This chart will help you visualize the distribution and relationships between categories in an eye-catching format. We need to be very careful while choosing the visualization charts. For a petal i was trying to use the superstore.xls from kaggle but it is not the suitable one. so i tried to create a data set for this petal chart.

Product Category

Sales

Path

Electronics

1200

0

Electronics

1200

1

Furniture

800

0

Furniture

800

1

Clothing

600

0

Clothing

600

1

Books

400

0

Books

400

1

Toys

900

0

Toys

900

1

Groceries

1100

0

Groceries

1100

1

Beauty Products

700

0

Beauty Products

700

1

Sports Equipment

1000

0

Sports Equipment

1000

1

Home Appliances

500

0

Home Appliances

500

1

Step 1: Prepare your data and Load or connect the data to the tableau public

Step 2: Create Calculated Fields and Bins to structure our data for the petal chart.


Create Path (bin):

  • In Tableau, right-click on the Path field in the Data pane.

  • Select Create > Bins.

  • Name it Path (bin).

  • Set Size of bins to 1.

  • Click OK.

Create Calculated Fields:

  • Index:

  • Right-click in the Data pane, select Create Calculated Field ("Index").

  • write the code : INDEX() - 1

  • TC_Degrees:

  • Create another calculated field " TC_Degrees"

  • write the code : 360 / WINDOW_COUNT(COUNTD([Product Category])) * INDEX()

  • TC_Size:

  • Create Calculated Field ("TC_Size").

  • write the code : MAX([Sales]) / WINDOW_MAX(MAX([Sales]))

  • X and Y:

  • Create another calculated field "X"

  • write the code : SIN([Index] * [TC_Degrees] * PI() / 180) * [Index] * [TC_Size]

  • Create another caluculated field "Y"

  • write the code : COS([Index] * [TC_Degrees] * PI() / 180) * [Index] * [TC_Size]

Step 3: Build the Worksheet

  1. Change the Mark Type:

  • In the Marks card, change the mark type to Line.

  1. Add Data to Shelves:

  • Drag Product Category to the Color shelf on the Marks card.

  • Drag Path (bin) to the Columns shelf.

  • Right-click on Path (bin) in the Columns shelf and ensure Show Missing Values is checked.



  • Drag Path (bin) to the Path shelf on the Marks card.

  • Drag X to the Columns shelf.

  • Right-click on X in the Columns shelf, go to Compute Using, and select Product Category.

  • Right-click on X again, select Edit Table Calculation..., and in Nested Calculations for Index, set Compute Using to Specific Dimensions and select Path (bin).



  • Drag Y to the Rows shelf.

  • Right-click on Y in the Rows shelf, go to Compute Using, and select Product Category.

  • Right-click on Y again, select Edit Table Calculation..., and in Nested Calculations for Index, set Compute Using to Specific Dimensions and select Path (bin).

  • It should appear like this



Step 4: Adjust the Visualization

To make the petal chart visually appealing, let's adjust its appearance:

  1. Remove Grid and Zero Lines:

  • Right-click on the chart background, select Format.

  • In the Format pane, set Grid Lines and Zero Lines to None.



  1. Fix the Range of the X and Y Axes:

  • Right-click on the X-axis and select Edit Axis.

  • Set the range from -1 to 1.

  • Repeat for the Y-axis.

  1. Hide the Axis Headers:

  • Right-click on the X and Y axes and uncheck Show Header.

  1. Drag Index to Size:

  • Drag Index to the Size shelf on the Marks card.

  • Right-click on Index in the Size shelf, go to Compute Using, and select Path (bin).

  1. Adjust Size Accordingly:

  • Adjust the size slider to make the petals visually appealing.

  • Final Look should be like this



  1. Add Tooltips:

  • Ensure tooltips are configured to show relevant information, such as Product Category names and Sales.

Step 5: Save and publish the workbook:

  • Review the chart and make any final adjustments to colors, sizes, and labels before saving and publishing the workbook in the tableau public.

Conclusion

You've created a beautiful petal chart in Tableau. This type of chart can effectively showcase the distribution and relationships within your data, making your visualizations not only informative but also visually striking.

By following these simple steps, you can transform your data into compelling visual stories. I hope you enjoyed Viszualizing Petal Chart with me.

83 views0 comments

コメント

5つ星のうち0と評価されています。
まだ評価がありません

評価を追加
bottom of page