I am using following simple shiny app code snippet to plot the output in the main pannel. But it doesn't render the plot as expected. It shows nothing in the browser. But When i run only the mPlot portion, it displays the plot in RStudio correctly with all interactions.
ui.R
library(shiny)
library(rCharts)
ui<-fluidPage(
headerPanel("Economics data with rCharts"),
mainPanel(
showOutput("myChart","polycharts")
)
)
server.R
library(shiny)
library(rCharts)
require(datasets)
server<-function(input,output){
output$myChart<-renderChart({
data(economics, package = 'ggplot2')
econ <- transform(economics, date = as.character(date))
m1 <- mPlot(x = 'date', y = c('psavert', 'uempmed'), type = 'Line',
data = econ)
m1$set(pointSize = 0, lineWidth = 1)
return(m1)
})
}
Hi you use the wrong JS library, it's morris, not polycharts, try :