Hi,

I have posted this issue in some other forum, however unable to get any 
satisfactory reply. Hope expert here would provide some some light/pointer 
how to achieve below.

I am tying to put some Googlevis plot in the tooltip of another Googlevis 
line chart as follows.


library(googleVis)
library(quantmod)

 sp500 = as.zoo(na.omit( 
   getSymbols(
    "SP500",
     src = "FRED",
     auto.assign = FALSE
   )
 ))

 sp500 = window(as.zoo(sp500), start = as.Date("2017-04-01"))

 ### Now a dummy TS, to be used in the tooltipDummy = tail(sp500, 10)Dummy.df = 
data.frame('date' = index(Dummy), 'data' = coredata(Dummy))
m = gvisLineChart(
   data = Dummy.df,
   xvar = "date",
   yvar = "SP500",
   options = list(
     title = "Dummy TS",
     height = 400,
     width = 600
   ))

htmlstring = paste(c(m$html$header,paste(m$html$chart,collapse = 
""),m$html$caption,m$html$footer),collapse = "\n")
final.df = data.frame('X' = index(sp500), 'Y' = coredata(sp500)[,1], 
'Y.html.tooltip' = htmlstring)

plot(gvisLineChart(
   data = final.df,
   xvar = "X",
   yvar = c("Y", "Y.html.tooltip"),
   options = list(
     title = "Final TS",
     height = 400,
     width = 600, tooltip = '{isHtml: true}'
   )))



However for some reason, I am not able to generate any plot. Probably I 
could not create right HTML code for my 1st plot 'm'. Could someone please 
help me with right pointer.

Thanks,

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/9987cbee-26ef-4639-8b3b-9668ee5b3b60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [visualization-api] Adding... Christofer Bogaso

Reply via email to