top of page
  • Writer's pictureSimon Beaumont

Margin line charts? That's what I'm calling them!


On Friday 6th April 2018 I was fortunate enough to be awarded Tableau Public Viz Of The Day for my #SportsVizSunday analysis of The Masters tournaments between 1934 and 2017.


As part of my visualisation I wanted to visualise the 'business end' of the tournament; i.e. the winning score and the score equating to the top ten; nothing too out of the ordinary so far as this could be done through two coloured lines. The unusual aspect of the visualisation related to my desire to also visualise the gap between the winner and second place, as part of the same line chart. Relating to this aspect of the visualisation, a big thank you to Dilyana Suleymanova (@DilyanaFlower) for reaching out on Twitter and commenting on the viz:

"I like the line with bar charts on it. This is something new I've not seen before."

I promised Dilyana I would share how I created the chart, so here's how:


Create 2 calculated fields that represent the winning score and top ten score, for my example of The Masters this used:

[Winner] : {fixed [Year] : max(if [Position (Int)] =1 then [Total Score] else 0 END)}

[Top 10] : {fixed [Year] : max(if [Position (Int)] <= 10 then [Total Score] else 0 END)}


Create 1 additional calculated field that calculates the 'winning margin', i.e. the difference between 1st and 2nd place:

[Winning margin] : {fixed [Year] : max(if [Position (Int)] =1 then [Total Score] END)-max(if [Position (Int)] =2 then [Total Score] END)}


In a worksheet create a line chart that uses Measure Values to plot the 2 calculated fields [Winner] and [Top 10] and place Measure Names on colour to distinguish between the 2 lines:











Add [Winner] to Rows and set to Dual Axis:

Note: You won't be able to synchronise axis so ensure they are manually set to the same limits.


Change the Marks type for the secondary axis to a Gantt Chart and place Measure Name on colour and set the colour to the same as the [Winner] line Marks.


On the Size option of the Gantt Chart place the following field:

-SUM([Winning margin])


This last step will create a Gantt chart that replicates the look of a bar chart with the size of the bar representing the size of the winning margin.


If you wanted to check out my Masters Viz Of The Day it can be found on my Tableau Public page:

https://public.tableau.com/profile/simon.beaumont#!/vizhome/SportsVizSunday-TheMastersAVisualHistory/TheMasters-AVisualHistory?:SHOWVIZHOME=NO



53 views0 comments

Recent Posts

See All
bottom of page