4

I have a scatter plot using googleVis and I'd like to define the text shown when I hover over a data point. When I try to use non-numeric data I get an error message. Here's the code:

library(googlVis)
df1 <- data.frame(id = seq(1,10,1), var1 = runif(10), var2 = runif(10))
df1$names <- c("jim","nancy","suzy","mark","alex","jen","luz","jeff","paula","amir")
head(df1)
df1Plot <- gvisScatterChart(df1[,2:4])
plot(df1Plot)

I'd like to have the person's name show up when I hover over the point on the plot.

Any suggestions?

zx8754
  • 52,746
  • 12
  • 114
  • 209
screechOwl
  • 27,310
  • 61
  • 158
  • 267
  • @BenBolker: sorry I edited. 2nd to last line s/b '2:4' instead of 2:3. – screechOwl Dec 08 '12 at 03:57
  • I poked around a bit and don't see any easy way to do it -- you might have to hack the code, or ask the maintainers: http://stackoverflow.com/questions/8437979/add-custom-text-to-google-visualization-tooltip may be *slightly* useful ... – Ben Bolker Dec 08 '12 at 17:20
  • 1
    http://lamages.blogspot.ca/2012/03/googlevis-0215-is-released-improved-geo.html says [re a question about tooltips] "Currently googleVis (version 0.2.15) doesn't support roles. Please ping us an email, if you have an idea how to do this." – Ben Bolker Dec 08 '12 at 17:27

0 Answers0