I use rCharts to implement interactive graphics in rshiny. I am using the morris library Here is a minimal example of my problem:
## ui.R require(rCharts) shinyUI(pageWithSidebar( headerPanel("rCharts: Interactive Charts from R using morris.js"), sidebarPanel( ), mainPanel( showOutput("myChart", "morris") ) )) require(rCharts) shinyServer(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) m1$addParams(dom = 'myChart') m1$params$width = 200 m1$params$height = 200 return(m1) }) })
The height and width components work fine if the m1 object is not sent brilliant, but they seem to be ignored after renderChart processing. I applied the interim fix using the stylesheet:
.shiny-html-output.morris{ height: 200px; width: 200px; }
Is there any option that I am missing? For example, in plotOutput in the shiny package, you can specify plotOutput("plot2", height = "260px") for example.
source share