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

Original


Source : Howmuch.net


Objective

The data on retail sales was obtained straight from the US Census Bureau. They used data from the previous two decades to produce an explosive sequenced pie graphic that shows annual totals accounting for inflation. They then added a layer that depicted the relative increase of e-commerce as a percentage of overall retail sales. As a consequence, you’ll get a visual representation of retail’s last two decades. Additionally, their visualisation depicts how overall retail sales are increasing. Since at least 2000, retail sales have climbed year over year, growing from 2.98 trillion dollars to 5.62 trillion dollars, except at the midst of the Great Recession in 2007 and 2008. This suggests that regardless of the sales channel, individuals are increasing expenditure in the retail industry.

The target audience probably are the companies trying to find out what customers want to adhere from the market and also the stock managers who want to predict the possible outcome of this current trend.

The visualisation chosen had the following main issues:

  • No contrasting difference: The Total and E-Commerce predictions in the intial plot may look fancy but the colours aren’t black and white print safe nor is it easy for people with colour blindness to exactly distinguish between the two colours.

  • Diagram is confusing: There’s no flow in the data depicted. One would have to rotate their head all over to find out what retail price was standing in a particular year which is too much effort for something that one could just find easily depicted using a line chart. The intital rule of a chart is to let the chart speak for the speaker while the speaker speaks as well not just the chart saying everything.

  • Misleading Diagram: The spiral may make the reader assume that with the continuing years the retail growth would be continous which is not the case. It fails to show where the dips in graph lie and at what point exactly the two retail rates synchronise.

  • Heavily clustered variables: Ever heard of too much on the paper; this plot is exactly that. The small box in the right corner holds information that is too difficult to read if someone were to sit in a room trying to find out what it says. T

Reference

Code

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

setwd("C:/Users/nupur/Desktop/DV Ass 2")
library(readr)
library(magrittr)
library(plotly)
library(readr)
ugly_viz <- read_csv("ugly_viz.csv")
Viz_df<-as.data.frame(ugly_viz)

#install.packages("ggplot2")

Viz_df['Retail_Total']<-Viz_df['Retail_Total']*1000000
Viz_df['Retail_Ecommerce']<-Viz_df['Retail_Ecommerce']*1000000


fig <- plot_ly(Viz_df, x = ~Year, y = ~Retail_Total, name = 'Total', type = 'scatter', mode = 'lines') 
fig <- fig %>% add_trace(y = ~Retail_Ecommerce, name = 'Ecommerce', mode = 'lines') 
fig <- fig %>% layout(title='Timeline of Retail Sales Growth in the US',yaxis=list(title='Retail',type='linear'),xaxis=list(title='Years',type='linear',nticks=20))

Data Reference

Reconstruction

The following plot fixes the main issues in the original.