As part of Week 2’s project to makeover one of our application visualisations for the Data School, I decided to makeover one of the key visualisations from my SpaceX dashboard. This blog post will show you how to plot points on the circumference of a circle and spread within a circle:
Before and After Visualisation Makeover
Original Visualisation Concept
One unique aspect of SpaceX is their track record for successful landing rockets on drone ships in the ocean. The original visualisation aims to visualise the proportion of rockets that successfully land on the drone ship compared to those who miss. This is illustrated using a circle with the SpaceX logo representing the landing zone of the drone ship. Marks inside the circle indicates success while marks outside indicates failure.
The original visualisation was a little rushed and I was unable to properly put the marks where I wanted them. A calculated field with nested If statements with the random function was used to plot coordinates based on the outcome of the landing which worked but didn’t look great. This approach led to the 4 corners being occupied with failed landings to appear as clusters which looks messy and suggests that there is a pattern here which is misleading.
The plan to makeover the visualisation involved plotting points evenly around the outside of the main white circle. The green ticks indicating successful landings would be evenly distributed within the white circle.
Part 1 (Inner Circle)
First we will generate points evenly and randomly inside a circle which is achieved using the following calculated fields:
- Start by creating an angle for the point.
- Then calculate the radius for the point. 0.9 is the radius of the circle. For this visualisation, we don’t want the points to go all the way to the edge.
- Next, the X coordinate is calculated using COS() for Successful Landings.
- Similarly, the Y coordinate is calculated using SIN() for Successful Landings.
- Finally, plot using a scatter plot with X on Columns, Y on Rows and Landing Success on colour and shape.
To read more about the formulas and trigonometry used to calculate these coordinates, visit this website.
Part 2 (Outer Circle)
The outer circle is different to the inner circle as it has multiple levels of evenly spread out points around a specific radius. To create this part of the visualisation, the following calculated fields are created:
- Assign a number to each point using INDEX().
- Then determine the spacing by dividing 360 (degrees in a circle) by the amount of points (SIZE()).
- Next, calculate the angle using the index and point spacing calculated earlier.
- There is a different radius for the failed and unknown landings. An If statement is used so a different radius is used for the calculation of coordinates.
- Modify the X Coordinate calculated field to calculate coordinates for failed and unknown landings using COS().
- Modify the Y Coordinate calculated field to calculate coordinates for failed and unknown landings using SIN().
- Finally, the visualisation should now show successful landings distributed inside the circle and failed/unknown landings neatly outside the circle in separate rings.
To learn more about the formulas used to evenly space points in a circle, refer to this website.
The final steps include removing the headers for the axis, fixing the tooltips and adding the background to produce the following visualisation:
Final Makeover Visualisation
I hope this blog post has been useful in demonstrating how to plot points around a circle in Tableau. I encourage you to visit the websites outlining the formulas used to create these visualisations. Their explanations are far more detailed than this blog post.