我想制作一个 ColumnChart,我可以在其中自定义每个图表元素的颜色。我试过这个:
> data
Company male female
1 0.6018735 0.3981265
2 0.6771300 0.3228700
3 0.7558140 0.2441860
companycolors <- "[ '#790700' ,
'#fbceb9' ,
'#0d055b' ,
'#8c8aaf' ,
'#0c0835' ,
'#443f9a' ]"
require(googleVis)
gvisColumnChart( data,
xvar = "Company",
yvar = c("male", "female"),
options = list(
colors = companycolors
)
)
但显然它只使用前两种颜色,并为公司二和三重复它们。有没有办法为每个图表元素赋予特定的颜色?