Select Page

Chord Charts help to show how strongly fields are related to each other. For example, if you want to see the number of people commuting between cities or flights operation between cities and countries. We need a bit of data preparation to build the cord chart. The dataset should contain the start point and endpoint. The dataset which I am using for this demo contains the source and destination airport. I will use passenger and aircraft trips as a weight to see the relationship.

Step 1

To start with data preparation, the dataset should contain the unique row id. If it does not just assign the one. In my dataset, it’s Row ID. Now select and pivot city1 and city2 fields. It will create two columns pivot field name (city1, city2)  and pivot field values (cities name). Rename pivot field values to Cities.

Step 2

Now create a calculated field for a Path between cities.

Step 3

The next step is to calculate unique points in the chord chart so we can link them. In my dataset, these will be cities. I have used count distinct using Fixed LOD.

Step 4

The next step is to create the Order and Angle field. I will be using the index() function to order my points. For angle, I need to create a calculated field.

Bring angle into columns and calculate it by using the Table down option. Bring cities and order into a row. It should look like below:

Step 5

To plot Cartesian coordinates we need two fields X and Y. Bring that into view X into columns and Y into rows.

Bring cities into detail.For X and Y modify table calculation by selecting specific dimensions – cities.

Step 6

Now duplicated the x field. Change the mark type of second x field to line. Drag the path field into the path of the second x field. Bring row id into detail as well. Modify the table calculation by selecting specific dimension-row id and cities.

Step 7

Make the chart dual-axis and synchronize the axis. Lastly, do the formatting bring cities into the size of circle mark type? Color the paths by the number of people travelled between city pairs.

You can also refer to viz in my tableau public profile. The link to that viz is as below:

https://public.tableau.com/app/profile/saqib786/viz/DomesticFlightsNetworkAcrossAustralia/Dashboard1