Unable to change size of dygraphs in Shiny

391 Views Asked by At

I am trying to decrease the size of my dygraph output. But all of my settings seem to be ignored.

I have tried specifying the height in both the dashboard layout and dygraph settings. All packages and software is up-to-date via github not CRAN.

enter image description here

Here is what I have tried below.

I have listed my code below in DOM hierarchical order to assist with your understanding.

shinyUI(dashboardPage(header, sidebar, body))

body <- dashboardBody(
  tabItems(
    ...
    tabItem(tabName = "comments_explorer_tab", tab_comment),
    ...
    )
  )

tab_comment <-  fluidPage(
  titlePanel("Data Explorer")
  column(
      ...
      width = 2 # reduce width of sidebar
  ),
  column(
      width = 10,
      fluidRow(height='50px',
        tabsetPanel(
          tabPanel("Time", height=50, dygraphs::dygraphOutput("comment_dygraph")))
      ),
      fluidRow(DTOutput("data_table"))   
  ) 
)

shinyServer(function(input, output) {

output$comment_dygraph <- renderDygraph({
       
        dygraph(comment_counts, height=50,  main = paste0("Daily Counts for "user")) %>%
            dyOptions(colors = RColorBrewer::brewer.pal(3, "Dark2"), includeZero = TRUE, retainDateWindow = TRUE) %>%
            dyAxis("x", drawGrid = FALSE) %>%
            dyAxis("y", label = "Counts")
    })

output$data_table <- renderDT({
        datatable(data = comment_time_selection(),
                  extensions = c("Scroller"),
                  options = list(
                      autoWidth = TRUE,
                      scrollResize =TRUE,
                      scrollX = TRUE,
                      scrollCollapse= TRUE,
                      scrollY = 100,
                      initComplete = I('function(setting, json) { alert("done"); }')
                      ),
                  rownames= FALSE
                  )  
    })
}

enter image description here

0

There are 0 best solutions below