I am trying to make a bubble chart with two coordinates and a size parameter with gooogleVis in R.
When I don't establish the colour variable, the size variable is used as colour instead of as size. I can include a colorvar but then the variable is displayed in the tooltip.
How can I avoid this behaviour?
I include a minimum working example with the two cases mentioned before:
library(googleVis)
set.seed(1)
bubbledata<-data.frame(id=rep("",100),X=sample(10,10,rep=TRUE),
Y=sample(10,10,rep=TRUE),Weight=sample(10,10,rep=TRUE))
# This graph uses sizevar as colorvar
bubble <- gvisBubbleChart(bubbledata, idvar="id",
xvar="X", yvar="Y",colorvar="",
sizevar="Weight")
plot(bubble)
bubbledata$colour<-""
# The output of this one is ok but the tooltip includes the colour var
bubble2 <- gvisBubbleChart(bubbledata, idvar="id",
xvar="X", yvar="Y",colorvar="colour",
sizevar="Weight")
plot(bubble2)
gsub()
etc, but it wasn't straight forward and I gave up after a half hour. I don't think it'll be very flexible in the end.You might want to submit a bug / file an issue with the developers for this one... – Hankhanke