I have this data frame called data:
head(data)
date total_sold purchasability visibility
81 2014-05-01 3 3 3
82 2014-05-02 2 2 3
83 2014-05-03 1 2 3
84 2014-05-04 1 3 3
85 2014-05-05 3 2 3
86 2014-05-06 0 0 3
And I would like to do a bar chart with x = date and y = total_sold with a color depending on the purchasability. I this ggplot2 to do that :
bar <- ggplot(data = data, aes(x = date, fill=as.factor(purchasability),y = total_sold)) + geom_bar(stat = 'identity')
The output is very nice but the problem is that where total_sold = 0 there is not chart and thus no way to know the purchasability. Is it possible to still display a bar (maybe from 0.5 to -0.5) when total_sold = 0 ?
Thanks