Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
The main objective of this visualization is to show the shift of consumers from in-person to e-commerce shopping in the USA over the years (2000-2020).
Targeted Audience
The main audience of this visualization are the e-commerce companies who want to get an estimate of the growth of e-commerce shopping in order to manage their resources accordingly. It’s also for financial analysts who want to learn more about the change in sales behaviour of the population.
The visualization chosen had the following three main issues:
Reference
The following code was used to fix the issues identified in the original.
# Importing libraries and reading file
library(ggplot2)
library(reshape2)
library(TSstudio)
library(dygraphs)
library(lubridate)
library(dplyr)
library(readxl)
AdjustedSales <- read_excel("/Users/kushagrasingh/Sem3/DataViz/AdjustedSales.xlsx")
# Data Preprocessing
AdjustedSales$Year <- as.character(AdjustedSales$Year)
AdjustedSales$Year <- as.Date(AdjustedSales$Year, format = "%Y-%m-%d")
SalesDF <- melt(AdjustedSales,id.vars = c("Year"))
# Plotting time series
p1<- ggplot(SalesDF,aes(x=Year,y=value,colour=variable)) + geom_line() + geom_point()
p2<- p1 + geom_jitter(position = position_jitterdodge())+ facet_wrap(~variable,ncol=1,scales = "free")+
labs(title = "Total Sales and E-commerce percentage of total sales growth by Year",
x ="Year (2000-2020)", y="Percentage of Total Sales (%) Sales (millions of dollars)")+
theme(axis.line=element_line()) +
scale_y_continuous(labels = scales::label_number_si())+
geom_text(aes(label=ifelse((value>100),paste(round(value / 1e6, 2)),paste(round(value, 1)))), vjust = -0.6,size = 2.2,position=position_dodge(width=0.6))
Data Reference
Martinčević, I., 2021. Charting Over 20 Years of Retail Sales and E-Commerce in the U.S. Retail Industry (Update). [online] HowMuch. Available at: https://howmuch.net/articles/timeline-retail-sales-growth-US [Accessed 27 April 2021].
SSSD, (., 2021. Monthly Retail Trade, Main Page - US Census Bureau. [online] Census.gov. Available at: https://www.census.gov/retail/index.html [Accessed 27 April 2021].
The main issues identified in original is addressed by-
The following plot fixes the main issues in the original.