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

Original


Source:MOBILE (BOND INTERNET TRENDS (2019))


Objective

The objecttive of this visualization is to show the rise of Daily hours spent with Digital Media over years from 2008 to 2018. The visualization shows average hours per day spent engaging with digital media (e.g. digital images and videos, web pages, social media apps, etc.) The data for ‘other connected devices’ includes game consoles. Mobile includes smartphones & tablets. Alldata includes both home & work usage for people 18+.

Targeted audience are the adults who spend more than 6 hours per day on digital media (apps and websites accessed through mobile phones, tablets, computers and other connected devices such as game consoles) and any interested general public and to generate the awareness for the rise in time spent over social media.

The visualisation chosen had the following three main issues:

  • Stack bar chart is used instead of line chart which is normally used when the variables change along the time.This causes perceptual issue as the readers have difficulty in comparing or finding trend of a selected category of data for that the bottom lines of the data in different year are not at the same level.

  • This visualisation has used both green and blue and people with Deuteranopia(Unable to perceive green) and Tritanopia(Unable to perceive blue) colur blindness will it find difficulty to interpret the data.

  • The stack bar does not define the data labels for Daily hour spent per adult for each category in particular year which makes it difficult to compare the rise in trend for each Media type.

Reference

Code

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

library(ggplot2)
library(readr)
library(dplyr)
library(tidyr)

Digital_Media<-read_csv("daily-hours-spent-with-digital-media-per-adult-user (1).csv")
Digital_Media<-Digital_Media%>%gather(`Mobile (BOND Internet Trends (2019))`,`Desktop/Laptop (BOND Internet Trends (2019))`,`Other Connected Devices (BOND Internet Trends (2019))`,key="Media_Type",value="Daily_hours_spent")
Digital_Media$Year<-factor(Digital_Media$Year)
Digital_Media$Media_Type<-factor(Digital_Media$Media_Type)


 P1<-ggplot(Digital_Media)+ #plot
  geom_line (aes(x=Year,y=Daily_hours_spent,colour=Media_Type,group=Media_Type))+ #add lines
  geom_point(aes(x=Year,y=Daily_hours_spent,colour=Media_Type))+
  geom_text(aes(x=Year,y=Daily_hours_spent,label=paste(Daily_hours_spent),colour=Media_Type),size=3,hjust=1,vjust=2)+
  scale_color_manual(values = c("dodgerblue4","khaki4","yellowgreen"))+ # assign colour
  theme_minimal()+ #make the background clean
  labs( title= "Daily hours spent with digital media per adult user ",subtitle="Period:Year 2008 to 2018")+
  ylab("Daily Hours Spent")+
  xlab("Year")+
  facet_grid(Media_Type~.,scales ="free" )+
  theme(strip.text.y = element_blank())

Data Reference

Reconstruction

The following plot fixes the main issues in the original.

  • The plot has common bottom line for each category of media type.

  • Data lables are defined in the plot for each category on particular year.

  • Red green and blue use of colour is avoided.

P1