Combine R shiny and googlevis motion chart

2019-08-04 13:51发布

I'd like to deploy a web site using R shiny with a googleVis motion chart, but when running the app, the motion chart showed up in another window in IE browser.

I'm wondering how the motion chart can show up together along with the R shiny. Thanks in advance.

server.R

  shinyServer(function(input, output) {

   project_sub<-subset(project_all, select=c("name", "generation",
                                      "man_cost", "quantity"))
   motionchart2<-gvisMotionChart(project_sub, "name", "year2") 

   output$view_gviz <- renderGvis
   ({
           plot(motionchart2)
   })
})

ui.R

  shinyUI(fluidPage(
     titlePanel("Analysis of Project NRE"),
     mainPanel(

        h1("Motion Chart"),
        h4("A Motion Chart is an alternative to providing a quick visual 
        overview ofprojects."),
        plotOutput("view_gviz")
      )
  ))

1条回答
做自己的国王
2楼-- · 2019-08-04 14:22

I ran into this problem. Try this in your ui.R

# googleVis needs htmlOutput not usual PlotOutput
htmlOutput("view_gviz")
查看更多
登录 后发表回答