HighCharts Window Size

76 views
Skip to first unread message

Jason Watts

unread,
Mar 12, 2016, 1:24:18 PM3/12/16
to Shiny - Web Framework for R
How can get my HighCharts plot below to resize when I change screen resolutions and when I minimize and maximize my dashboard window. It doesn't fit correctly when I change.

My code is below.

library(rCharts)
library(shiny)
library(shinydashboard)
header <- dashboardHeader(
)
sidebar <- dashboardSidebar(width = 350,
sidebarMenu(
menuItem("HighChart", tabName = "tab", icon = icon("dashboard"))
)
)
body <- dashboardBody(
tabItems(
tabItem("tab",
            fluidRow(
            box(title = "HighCharts",  
                  width=6,
                  solidHeader = TRUE,
                  status = "primary",
                  collapsible = TRUE,
                  div(style='display:inline-block;width:100%', 
                      wellPanel(showOutput("chart", "highcharts")))
                    ))
)))
server <- function(input, output) {
 output$chart <- renderChart2({
  d <- hPlot(Pulse ~ Height, data = MASS::survey, type = "bubble", title = "Zoom Demo", subtitle = "Bubble Chart", size = "Age", group = "Exer")
  d$chart(zoomType = "xy")
  d$exporting(enabled = T)
  d$chart(width=690,height=400,zoomType = "x",marginTop="50",marginBottom="50")
  d
  }) 
}
shinyApp(
  ui = dashboardPage(header, sidebar, body, skin = "blue"),
  server = server
)

Reply all
Reply to author
Forward
0 new messages