r - googleVis: Colors with alpha < 1 -
i trying use colors alpha < 1 in googlevis chart without success.
my initial color list applied is:
mycolors <- c('#dd4477', '#109618', '#aaaa11)
then apply function adjustcolor: myalphacolors <- adjustcolor(mycolors, 0.4)
if try use these colors in googlevis chart error: #109618e6 not valid color string
how overcome problem , use colors alpha < 1 in googlevis charts?
here reproducible example (in particular case don't error message second series colors not plotted properly):
library(googlevis) mycolors <- c('#dd4477', '#109618', '#aaaa11') df <- data.frame(country=c("us", "gb", "br"), val1=c(10,13,14), val1.style = mycolors, val2=c(23,12,32), val2.style = adjustcolor(mycolors, 0.4)) plot(gviscolumnchart(df, xvar="country", yvar=c(colnames(df)[2], colnames(df)[3], colnames(df)[4], colnames(df)[5]), options=list(legend="none", chartarea = "{left:'10%',top:'10%',width:'80%',height:'70%'}", height=750, width=1050, backgroundcolor = "white") ) )
Comments
Post a Comment