I know what is needed: polygon in dual axis with scatter plot. But I never did it before. It still took some research and optimizations to make it work. Bora Beran's blog is a great source of inspiration to me in my research.
1.Data preparation
To add radial references, we need to prepare your data first. That is, add a few rows to the data set. This can been done by Union in SQL.
Assuming we want 3 reference arcs, then we need 6 rows or 2 rows per arc. The 2 rows designate both start and end points for each polygon-based arc. Here we will use 102 points for each polygon. 102 points seem enough to make the arcs look smooth. More points can be added if necessary.
Note that there is a Reference column in the table which labels rows for arcs and data.
2.Drawing Arcs
This will use the data densification technique native to Tableau. The main steps are:
- create bins based on [Path] with step size = 1. This will create potentially102 bins.
- drag Path bin to Rows
- right click Path bin on Rows and select Show Missing Values.
- select Polygon as data mark
- drag Path bin to the Path shelf in Polygon data marks.
Then create coordinates for the arcs.
- X Arc and similar for Y Arc
3.Creating the Scatter Plot
Use X and Y and the plot is easy. Dot Size can be any measure that will show in the size of each dot.
4.Dual axis both Arcs and Scatter Plot
We need to have a single horizontal axis variable for both charts. Here is X All:
- IF ATTR( [Reference] )='Data' THEN ATTR( [X] )
- ELSE [X Arc]
- END
Voila, it's basically done.
Click the image to go to the interactive version.
Note that we use one parameter for each arc's radius. The radius can be changed to any value.
The number of points for an arc can also be a parameter. Here we just use a fixed number: 102.
There seems that the number of arcs can not be parametrized. We need to define the number of arcs a priori.
6.Generalization
We assumed that the scales of both X and Y axis are the same. In some cases, this may not be true. Then an arc may not be a quarter of a circle. Instead, it is part of an ellipse. If that's the case, we have to calculate the coordinates differently.
7.Use cases
Forrester Research has been using scatter plots with radial references for years. Check them out: https://goo.gl/oJZ6p7
View comments