Tableau Tutorial: Filled Circle
I am always looking for fun ways to use Tableau, and in this tutorial, I am going to show you how to build Filled Circles. This tutorial is nice and quick and should take around 5-10 minutes. So let us get started.
The Data
Create the following in Excel and then paste it into Tableau:
Quite a small data source, but let us now create our Calculated Fields.
Calculated FieldsWe will create a Path (bin) object by:
- Right click on Path
- Go to Create, Bins…
- In Edit [Path] set the Size of bins to 1
- Click Ok
The Path (bin) will allow us to use a table calculation to create additional data points between 1 and 360.
Note: we are using the Path (bin) for the densification of data which will give us more points to work with. One thing to make sure of is that you check the Show Missing Values.
We will now create the following Calculated fields.
Index: We are going to use this to draw the individual points.
WC_PI: This is used to get the value of PI and make it available to the densified data.
WC_Value: This is used to make the Value available to the densified data.
WC_Depth: This is used to calculate how far down the circle we should straighten off.
X: This is used to draw the points on the X axis.
Y: This is used to draw the points on the Y axis.
Note: We have some code commented out, we will get back to this later.
Y 2: This is used to draw the points on the Y axis, but does not have a flattening effect.
Color: This is used to color the Filled Circles.
Now that we have our variables created we are not going to build our worksheet.
Note: I use the prefix WC so that I can recognise when a Calculated Field is a Table Calculation.
The Worksheet
Let us create our worksheet.
- Drag Path (Bin) onto the Details Mark
- Drag KPI onto Columns
- Drag WC_Value onto Columns. Right Click on WC_Value, click Compute Using, Select Path (Bin)
- Drag X onto Columns. Right Click on X, click Compute Using, Select Path (Bin)
- Drag Y 2 onto Rows. Right Click on Y 2, click Compute Using, Select Path (Bin)
- Drag Y onto Rows. Right Click on Y, click Compute Using, Select Path (Bin)
- Right click on Y and select Duel Axis. Right click on the Y axis and select Synchronize Axis
- Remove Measure Names from all the Color Mark
Note: Make sure the Path (Bins) have Show Missing Values selected. Without this, we won’t be able to get our additional values to draw our shapes.
We should now see the following:
Now we will format our Dashboard:
- Right click on all the X, Y and Y 2 Axis and untick Show Header
- Format and remove the background lines.
- In the Mark Type select Polygon. Control click and Drag (to copy) Path (Bin) to the Path Mark
- Click on Y in the Marks Panel. Drag Color onto the Color Mark. Click on Color and change colours to match the text. Change the Border Color to White.
Keep on formatting until you have something like the following:
And that is a wrap. A nice, simple, and fun way of displaying KPIs. I hope you enjoyed this quick blog, do let me know how you get along @thoang1000 or comments below.
P.s. Now for extra credit, edit the Y object by removing the comments to get a nice fun wave effect, a little buggy, but I will fix it soon.
Website: www.toanhoang.com, Twitter: thoang1000
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/course/creating-bespoke-data-visualisations-in-tableau
Hi Toan. This is great wizz but It seams that 20 and 80 % are not represented correctly in the circles. 20% is more like 10% and 80% is closer to 90%. Is there a way to adjust position of lever to be more accurate?