Pride of Anglia Bar Chart Race

I’ve recently seen several animated graphs appearing on my Twitter feed depicting various different types of data such as the most populous cities in the world and brand names by income. After the initial wow factor at data being shown this way I decided I wanted to find out how they are done and, as always, the best way of learning is by doing. So this article describes the process I went through.

The first thing that you need is a data source and I decided that I’d use my interest in football to create a bar chart race showing the most successful team in East Anglia based on their final league position in each football season since the end of the World War Two. I used Wikipedia as my source, probably not the best source for this kind of data but it came up first in a Google search so I used it.

The first challenge was to translate the league positions in each division to an overall place in the league structure this meant being aware of when divisions were restructured. I decided not to include a team until they first entered the four league divisions but did include positions for teams if they dropped into non-league having already entered the league structure.

The end result after a fairly complicated formula in the spreadsheet gave me a number for each team for each season after they first entered the league. The next task was to find a way to generate my bar chart race.

I looked at a few ways of creating the final product and settled on Flourish as one that seemed to have the easiest path to entry. I created a new Visualisation and found the bar chart race template. A default set of data loads but I then switched to the Data section and deleted what was already there. I then used the Upload data file option to upload my spreadsheet. My spreadsheet had columns for each team to show their league position for each season with the seasons in column A. This didn’t map to the bar chart race but fortunately Flourish includes an option to switch rows and columns which was exactly what was needed to structure the data correctly. The next thing was to do some formatting to make it look a bit better. Flourish makes this easy by allowing you to dedicate a column of data that can be used to categorise data by colour and another that can be used to hold an image. I chose to represent the main colour of the team’s shirts in the Category column and to store their badge in the Image column. Having done what was necessary on the Data section I switched back to the Preview window and saw the fruits of my labour which wasn’t too bad for a first attempt. There were a few options that I tweaked, for example slowing down the transitions and adjusting font sizes. Here’s the final output:

Overall Ipswich finished higher in 46 seasons and Norwich higher in 25 seasons. Both Colchester United and Southend United actually finished highest in one season but because of the transition speed they never quite take their place at the top – perhaps I’ll try and slow the transitions down further in a future update.