Objective
The objective of the original data visualisation was to demonstrate the change of the air quality index (AQI) in Beijing over the time of 2015-2018, showing that the air quality in Beijing was getting better. The targeted audience of this visualisation was the potential tourists to be attracted to Beijing or those travellers who already booked trips to Beijing.
The visualisation chosen had the following three main issues:
Inappropriate choice of chart type: the use of pie charts is not the best way to represent the data in this case. The pie charts made it difficult for the audience to compare the AQI values in different years for different categories. Especially in this case when some of the portions were similar in different years.
Failure to achieve the demonstration purpose (or to answer a practical question): this visualisation failed to display clearly how the air quality in Beijing improved over time. Even though it was designed for that purpose, it failed to achieve the goal by the current form of presentation.
Redundant information: the names of the categories were repeated four times in the pie charts drawn for all four years, as well as in the form of legend. This tended to be redundant rather than useful information.
Reference ChinaDiscovery.com (2020), Beijing Air Quality: Beijing AQI Today, Real Time, History, Statistics, https://www.chinadiscovery.com/beijing-tours/weather-seasons/beijing-air-quality.html (accessed 9.22.20)
#import libraries
library(ggplot2)
library(readr)
library(tidyr)
#load the data
df <- read_csv('airbeijing.csv')
#data preprocessing
df <- df %>% gather('2015', '2016','2017', '2018', key = "year", value = days)
#Grouping the AQI Level
df$AQI <- factor(df$AQI,levels=c("Good Days (0-50)","Moderate Days (50-100)","USG Days (100-150)","Unhealthy Days (>150)"))
years <- factor(c("2015", "2016", "2017", "2018"))
#Plotting the data using bar chart
p <-
ggplot(data = df, aes(x = year, y= days)) +
geom_bar(aes(fill = AQI), color = "black", position ="dodge",
stat = "identity", width=0.6) +
labs(title = "Beijing Air Quality Index - AQI (2015-2018)",
caption = "Source: ChinaDiscovery.com (2020) https://www.chinadiscovery.com/beijing-tours/weather-seasons/beijing-air-quality.html") +
xlab("Year") +
ylab("Number of Days") +
theme(
legend.text=element_text(size=8),
legend.position = "top",
axis.title.y = element_text(face = "bold", margin = margin(t = 0, r = 20, b = 0, l = 0)),
axis.title.x = element_text(face = "bold"),
plot.title = element_text(hjust=0.5, size = 12, face = "bold"),
plot.caption = element_text(size = 7, face = "bold"),
axis.text.y = element_text(color = "black", face = "bold"),
axis.text.x = element_text(color = "black", face = "bold")) +
scale_fill_manual(values = c("#56B4E9", "#009E73", "#E69F00", "#999999"))
Data Reference Beijing Air Quality: Beijing AQI Today, Real Time, History, Statistics, https://www.chinadiscovery.com/beijing-tours/weather-seasons/beijing-air-quality.html (accessed 9.28.20)
The following plot fixes the main issues in the original.