mages / googleVis

Interface between R and the Google Chart Tools
https://mages.github.io/googleVis/
358 stars 156 forks source link

Multiple input columns for "hovervar" in gvisGeoChart? #52

Open Masonavic opened 7 years ago

Masonavic commented 7 years ago

Hi,

I noticed that in the documentation for GeoCharts, they show an example where they use 2 columns of data for the hovervar. On the other hand, the documentation for gvisGeoChart seems to imply that only one column of data can be passed to the hovervar argument. Is this the case? If so, will you be implementing multiple columns? It seems like a reasonably easy thing to do, looking at the var data = block in the documentation link above...

thanks!

mages commented 7 years ago

Isn't this already doable by specifying the colour and size variables? Here is an example:

library(googleVis)
CityPopularity$Area = 1:6
plot(gvisGeoChart(CityPopularity, locationvar='City', 
  colorvar='Popularity', sizevar = 'Area', 
  options=list(region='US',displayMode='markers'))
Masonavic commented 7 years ago

For a city, sure. But I want to do this at a country level. Like, say, have the tooltip show the total population and GDP, or instance, while the map color intensity shows population density.

mages commented 7 years ago

Ah, ok. Not sure this is possible.