我希望当图表上的线低于 0 时为红色且高于绿色。我试图弄清楚我自己,但是,当我只需要低于 y=0 的颜色时,该代码在周五至周六的整个部分为我提供了一种颜色(“红色”,因为它低于 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, …Run Code Online (Sandbox Code Playgroud)