Search code examples
rgooglevis

controling size of Bubble chart's circle using googleVis in R


I did it using googleVis

> library(googleVis)

> trees2<-trees

>trees2$id<-as.character(1:31)

> Bubble<-gvisBubbleChart(trees2,idvar="id",xvar="Girth",yvar="Height",sizevar="Volume",options=list(vAxis="{title:'height'}",hAxis="{title:'Girth'}"))

> plot(Bubble)

and I had a chart but the circles are too large;;

Is there a way to control the size of the circle just like the symbols function?


Solution

  • You can use the sizeAxis option

    library(googleVis    
    trees2<-trees    
    trees2$id<-as.character(1:31)    
    Bubble<-gvisBubbleChart(trees2, idvar="id", xvar="Girth" ,yvar="Height",sizevar="Volume"
                            , options=list(vAxis="{title:'height'}",hAxis="{title:'Girth'}", sizeAxis = '{minValue: 0,  maxSize: 10}'))    
    plot(Bubble)
    

    Full list of options are given here.

    buuble chart