0

I am trying to use some colors with alpha < 1 in googlevis chart without success.

My initial Color List that is applied is:

MyColors <- c('#DD4477', '#109618', '#AAAA11)

Then I apply the function adjustcolor: MyAlphaColors <- adjustcolor(MyColors, 0.4)

If I try to use these colors in a googlevis chart I get the error: #109618E6 is not a valid color string

How could I overcome this problem and use some colors with alpha < 1 in my googlevis charts?

Here is a reproducible example (in that particular case I don't get the error message but the second series colors are 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")
                     )
    )
Christos
  • 805
  • 8
  • 25
  • What is the content of `MyAlphaColors`? –  Nov 27 '14 at 10:07
  • Here is the content: `c('#DD447766','#10961866','#AAAA1166','#10961866','#FF990066','#10961866','#3366CC66','#DC391266','#FF990066','#10961866','#99009966','#99009966','#22AA9966','#58585866','#00000066')` – Christos Nov 27 '14 at 10:18
  • At this stage, we need more information, particularly a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) –  Nov 27 '14 at 11:57
  • @Pascal I hope the example I added includes the additional information you were looking for. – Christos Nov 28 '14 at 13:07

0 Answers0