title: Automatically resize rChart in shiny
body: <p>How can I automatically resize an rChart plot in shiny? I would like to fit the plot to the screen of the user, like it is done for regular plots with renderPlot. Here's a minimal example:</p>
  
  <pre><code>#Server.R
  require(rCharts)
  shinyServer(function(input, output) {
    output$chart1 &lt;- renderChart2({
      r1 &lt;- rPlot(mpg ~ wt | am + vs, data = mtcars, type = "point", color = "gear")
      return(r1)
      })
    })
  
  
  #ui.R.
  require(rCharts)
  options(RCHART_LIB = 'polycharts')
  shinyUI(shinyUI(fluidPage(
  titlePanel("title panel"),      
     sidebarLayout(
        sidebarPanel("sidebar panel"),
          mainPanel("main panel",
                     chartOutput("chart1", 'polycharts'))
        )
      )
   ))
  </code></pre>
  
  <p>I tried adding:</p>
  
  <pre><code>w &lt;- session$clientData$output_chart1_width
  r1$set(width = w)
  </code></pre>
  
  <p>but it does not work. </p>