I am trying to create a Stacked Bar Graph using ggplot2. Here is how my data looks like
Date Full.Page.Ads Total.Pages 11/10/2015 3 24 12/10/2015 10 24 13/10/2015 15 24
This is the code which I am trying to use to visualize the data
library("ggplot2") library("reshape2") ns <- read.csv("NS.csv") ggplot(data=ns, aes(x = Date, y = Total.Pages, fill=Full.Page.Ads)) + geom_bar(stat = "identity")
But for some reason rather than making a proper stacked bar chart, it keeps making something like this http://imgur.com/rqxEzjF.jpg. Rather than this I would like to show the main bars as Total.Pages and inside those bars, Full.Page.Ads bar in different colours.
I am not sure what I am doing wrong out here.
This is a sample of what I am aspiring to make http://blog.visual.ly/wp-content/uploads/2012/08/StackedPercent.png