I want that when the line is below 0 on the graph to be red and above green. I tried to figure out my self, however, the code gives me a color ("red" as it is below 0) for the whole part of Friday-Saturday when I need this colour only below y=0.
a<-structure(list(group = c("Total", "Total", "Total", "Total",
"Total", "Total", "Total"), measure = c("sales", "sales", "sales",
"sales", "sales", "sales", "sales"), day = structure(1:7, .Label = c("MONDAY",
"TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"
), class = "factor"), variable = structure(c(1L, 1L, 1L, 1L,
1L, 1L, 1L), .Label = c("ALL", "DE", "BE", "NL", "AUS", "ES",
"IT", "FR", "PO"), class = "factor"), value = c(2400000, 3750000,
3400000, 3100000, 2300000, 3600000, 3100000), per_mtoday = c(2400000,
2400000, 2400000, 2400000, 2400000, 2400000, 2400000), per_mtoday_perc = c(0,
0.5625, 0.416666666666667, 0.291666666666667, -0.0416666666666667,
0.5, 0.291666666666667), colour1 = c("green", "green", "green",
"green", "red", "green", "green")), row.names = c(1L, 15L, 29L,
43L, 57L, 71L, 85L), class = "data.frame")
ggplot(a, aes(x=day, y=per_mtoday_perc,fill = colour1, color= colour1,group = 1)) +
geom_line(lwd=1.5)+
scale_y_continuous(labels = scales::percent)