I would like to add a scrollbar for a plot in Shiny app, but only the vertical scroll bar appear while horizontal scroll bars do not appear. I attached a small shiny app with minimum elements here to demonstrate the problem.
cat("\014")
unlink(".RData")
rm(list=ls(all.names = TRUE))
# A basic shiny app with a plotOutput
shinyApp(
ui = fluidPage(
sidebarLayout(
sidebarPanel(
),
mainPanel(
column(6,(div(style='width:200px;overflow-x: scroll;height:200px;overflow-y: scroll;',
uiOutput("plot"))) )
)
)
),
server = function(input, output) {
output$plot <- renderUI({
output$plot2 <- renderPlot(plot(cars))
plotOutput('plot2')
})
}
)