Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.

Original


Source: (“NHL Playoff Odds -MoneyPuck Analytics Based Playoff & Cup Odds”, 2019)


Objective

This visualistion, 5 pie chart’s merged into one is a season simulator showing the odds of the 31 National Hockey League(NHL) teams making the playoffs, 2nd round, 3rd round, finals and winning the league.The consecutive levels in the pie chart exhibit hierarchical relationships.

The target audience for this visualisation is sport bookies, current and potential sponsors along with fanatics who love to support their teams, all these would benefit in some way from this data and it’s visualisation.

The visualisation had the following three main issues:

  • Deception through Pies and Doughnuts - There are multiple pie charts in one visualisation with 31 categories making it impossible to interpret also angle/proportions are difficult to compare among different teams making this quite a controversial data visualisation

  • Visual Bombardment- The visualisation includes too much information (Innumerable colours,data proportions and comparisons) which paints a complicated picture ,therby distracting the audience from real message in the data and making it difficult to comprehend

  • Colour - Few NHL Teams are coded with indistinguishable colours(specially the shades of red and blue),as the colour is not discrete this draws connections between unrelated elements. Furthermore,usage of several colours makes the data visually difficult to interpret and this visualisation is not colour blind friendly

Reference

Code

The following code was used to fix the issues identified in the original.

library(ggplot2)
library(readxl)
library(dplyr)
library(tidyr)

# reading and cleaning the data, preparing for analysis and plotting
nhl_data <- read_excel("NHLDATA.xlsx")
nhl_data<-nhl_data %>% gather(`Make Playoffs`:`Win Cup`,key=type,value=percent) %>% select(Team,type,percent)
nhl_data$type<- factor(nhl_data$type,levels = c("Make Playoffs","Make 2ndRound","Make 3rdRound", "Make Final","Win Cup"),labels  =c("Playoffs","2nd Round","3rd Round", "Final","Win Cup"),ordered=T)
nhl_data$percent <- nhl_data$percent*100
names(nhl_data)[2]<-"Rounds"

# using ggplot2 tools to plot the reconstructed graph

bar<- ggplot(data=nhl_data,aes(x=reorder(Team,-percent),y=percent,fill=Rounds)) 

# We now add different layers to this bar using ggplot tools, we will make a grid of the different rounds this will make it easier to compare between teams as well as across teams 

Final_plot<-bar + geom_bar(position = "dodge",stat = "identity")  + facet_grid(Rounds~.)  +
  scale_y_continuous(limits=c(0,max(nhl_data$percent)+20)) +
  geom_text(data = nhl_data, aes(x=Team, y = percent, label = paste0(round(percent,1),"%")),
            position = position_stack(vjust = 1.2),size=5) + 
            theme( # to make a white background for our visual
              panel.border = element_blank(),  
              panel.grid.major = element_blank(),
              panel.grid.minor = element_blank(),
              panel.background = element_blank(),
              axis.line = element_line(colour = "grey")
            ) +
  ylab("Percentage chances (%)")+ xlab("Teams") + 
  theme(axis.text=element_text(size=18,face="bold"),
       axis.title=element_text(size=18,face="bold"),strip.text.y = element_text(size = 16,  angle = 90,face="bold"), legend.position = "bottom", legend.text = element_text(size=16, face="bold"),legend.title = element_text(color = "darkblue", size = 18,face = "bold")) + # changing the size and appearance of various elements for the graph 
  scale_fill_manual("Rounds", values = c("Playoffs" = "#1b9e77", "2nd Round" = "#d95f02", "3rd Round" = "#7570b3","Final"="#e7298a","Win Cup"="#66a61e")) # adding manual colours using the online tool ColorBrewer 2.0 

Data Reference

Reconstruction

The following plot fixes the main issues in the original.