我们使用R脚本创建了一个漏斗图,但无法将背景颜色从白色更改为彩色#00355c
。
所用代码:
library(plotly)
fig <- plot_ly()
fig <- fig %>%
add_trace(
type = "funnel",
y = c("Invoiced", "Cancelled", "Collected", "Write Off", "Out Standing"),
x = c(ZF_ZFO2CV001_OTC_002$`Net Invoiced (ABS)`,
ZF_ZFO2CV001_OTC_002$`Cancelled (Net Invoiced)`,
ZF_ZFO2CV001_OTC_002$`collected (ABS)`,
ZF_ZFO2CV001_OTC_002$`Write Off (ABS)`,
ZF_ZFO2CV001_OTC_002$`Outstanding Amount`))
fig <- fig %>%
layout(yaxis = list(categoryarray = c("Invoiced", "Cancelled", "Collected", "Write Off", "Out Standing")))
fig
期望将背景颜色从白色更改为#00355c
。
1条答案
按热度按时间k5hmc34c1#
您需要在
layout()
中指定plot_bgcolor
、paper_bgcolor
或两者。我用灰色和你确定的颜色来表示哪个参数做什么。