0

I used googleVis to generate a chart object (x) then outputted it as:

cat(x$html$chart, file="y.html")

How do I input this raw .html file into a Shiny server.R and then get it to render properly on the ui? I can't find anything. I've tried with

y <- readLines("y.html") output$Plot = renderHTML(HTML(y))

and

shinyUI(fluidPage(
  titlePanel(""),      
  sidebarLayout(
    sidebarPanel(
       ...
    ),
    mainPanel({
      htmlOutput("Plot")
    }
    )
  )
))

but this just generates a blank area. I omitted sidebarPanel because I know that works with my rendergVis() code that I was running.

Anyone know how to do what I'm trying to do?

milkmotel
  • 402
  • 4
  • 13
  • you need to supply the original code to your shiny server.ui – Cyrus Mohammadian Sep 14 '16 at 16:42
  • I did. I added more but I don't see how seeing that code helps you at all. The sidebar generates fine. The inputs work fine because they worked with directly rendering googleVis charts with the data. I want to change it to a basic HTML render so I don't have to load in all the raw data into the Shiny app environment, because the outputs are already stored in the HTML files I generated. – milkmotel Sep 14 '16 at 17:57
  • The html file probably contains HTML headers which won't work inside another html page. You can either extract only the googleVis part of the HTML, or try use `tags$iframe`. – Xiongbing Jin Sep 14 '16 at 20:07

0 Answers0