How to create easy chord diagrams in Tableau
This article is for those Tableau users who want to go one step further and combine Tableau features with a little trigonometry to build circular chord diagrams.
A chord diagram is a type of chart that shows relationships between nodes. It is useful when we want to identify what are the most common connections among a group of entities. It is also useful to identify communication gaps.
In this case, we are trying to see how often different roles of an Agile Release Train meet each other, based on the number of ceremonies they have in common.
Data model
We are going to analyze the relationship between two entities: People, Ceremonies. This is a many-to-many relationship, since many people can attend a single meeting, and a ceremony can include many people.
From this ERD, we can go to a physical diagram of three tables: one for People, one for Ceremonies, and one for the Attend relation. These tables will be the data sources for our Tableau project.
Tableau project
We are trying to see how different People interact, based on the Ceremonies they have in common. In order to do that, we are going to join two instances of the Attend table, each one with the details of People and Ceremonies.
Note: attend and attend1 join using meeting_id only.
We are going to need some calculated fields that will help us achieve our goal:
final_id: This is a unique identifier for each interaction. Notice that a single interaction will have two rows after the join:
person1-meeting1 → person2-meeting1 and
person2-meeting1 → person1-meeting1 should have the same final_id.
IF [Id] < [Id (Attend1)]
THEN str([Id]) + str([Id (Attend1)])
ELSE str([Id (Attend1)]) + str([Id])
END
total_people: This is the total number of People, regardless of the level of detail of the view:
{FIXED :MAX([Person Id])}
Chord Diagram
We want to build a circular chord diagram to show the interactions between People. This is a custom Tableau chart, it is not ready to use like a line or a pie chart.
We are going to represent People as equally-distributed dots in a circle. For simplicity, we will set the radius of that circle to 1.
We will use simple trigonometry to calculate the coordinates X and Y of each dot dynamically, as a function of the angle α.
New calculated fields in Tableau:
angle: angle of each dot as a function of the person_id
([Person Id] — 1) * 2*PI() / [total_people]
X: x-axis coordinates of each dot
COS([angle])
Y: y-axis coordinates of each dot
SIN([angle])
Chord Diagram
Now that we have everything we need, let’s build the chord diagram
Columns and rows. Notice that we are using “dual-axis” in the Rows box
Circle chart to display the dots and labels
Line chart for chord diagram
Remember to synchronize the axis. I recommend fixing the axis to go from -2 to 2, so you have enough place to display the labels.
You can customize the colors as you like. In this case, I am using grey for all the ceremonies except for the Product Owner sync one. I have also removed grid lines and zero lines.
That’s it! Now you can integrate this chart in your dashboard, create filters, highlighters, or anything you want.
You can find a copy of this chart here