Toan Hoang

Creating a Circular Network Chart in Tableau

This is one that has been in my backlog for ages, and while I am sure there will be updates to this (I want to make this a little more dynamic), I wanted to write this tutorial for you to enjoy. In this tutorial, we will create a Circular Network Chart in Tableau.

Note: This is an alternative type of data visualisation, and sometimes pushed for by clients. Please always look at best practices for data visualisations before deploying this into production.

Data

We will start by loading our data into Tableau Desktop / Tableau Public.

From,To,Starting,Ending,Value
A,B,1,2,96
A,C,1,3,47
A,D,1,4,41
A,H,1,8,61
A,I,1,9,13
A,J,1,10,51
B,D,2,4,93
B,E,2,5,82
B,F,2,6,19
B,H,2,8,71
B,J,2,10,32
C,D,3,4,87
C,F,3,6,5
C,H,3,8,19
C,J,3,10,51
D,E,4,5,17
D,H,4,8,62
D,I,4,9,30
D,J,4,10,12
E,F,5,6,91
E,G,5,7,22
E,J,5,10,69
F,I,6,9,18
F,J,6,10,91
G,H,7,8,61
G,J,7,10,90
H,I,8,9,14
H,J,8,10,60

Once your data is loaded into Tableau, right-click on the data source and click on Edit Data Source… with the Data Source Editor open, paste our model data:

Path
0
1

Note: If you are using Tableau 2020.2 or great i.e. have access to new Relationship Model, you will need to double-click on the originally pasted data source to open up before pasting in the Path Data.

You should get an error as there is no joining column, however, click on Add new join clause, go to Create Join Calculation, type 1 and click OK. Do this for the right-hand side as well. Ensure that you have Inner join selected and you should see the following:

Note: we will be performing data densification and therefore we will perform a cross-join between the data source and the model.

Calculated Fields

With our data set loaded into Tableau, we are going to create the following Calculated Fields:

Path (bin)

Route

[From]+"-"+[To]

Index

INDEX()

TC_Starting

WINDOW_MAX(MAX([Starting]))

TC_Ending

WINDOW_MAX(MAX([Ending]))

TC_Circumference

360 / WINDOW_MAX(MAX([Ending]))

X

IF [Index] = 1 THEN    
    SIN(RADIANS([TC_Starting]*[TC_Circumference]))
ELSE
    SIN(RADIANS([TC_Ending]*[TC_Circumference]))
END

Y

IF [Index] = 1 THEN    
    COS(RADIANS([TC_Starting]*[TC_Circumference]))
ELSE
    COS(RADIANS([TC_Ending]*[TC_Circumference]))
END

With this done, let us start creating our data visualisation.

Worksheet

We will now build our worksheet:

If all goes well, you should see the following:

Ok, this is pretty cool, and I assure you that I will be doing something with this in due course, but let us move on.

Pretty simple, and you should now see the following:

We are getting closer, but now we need to add our large circles:

You should now see the following:

We will now add the final touches to our data visualisation:

You should now want to see the following:

and boom, we are done! I hope you enjoyed creating this data visualization and learned some cool techniques as well. As always, you can find this data visualisation on Tableau Public at https://public.tableau.com/profile/toan.hoang#!/vizhome/CircularNetworkGraph/CircularNetworkGraph

Summary

I hope you all enjoyed this article as much as I enjoyed writing it and as always do share the love. Do let me know if you experienced any issues recreating this Visualization, and as always, please leave a comment below or reach out to me on Twitter @Tableau_Magic. Do also remember to tag me in your work if you use this tutorial.

If you like our work, do consider supporting us on Patreon, and for supporting us, we will give you early access to tutorials, exclusive videos, as well as access to current and future courses on Udemy: https://www.patreon.com/tableaumagic

Exit mobile version