我想在 Shiny 应用程序中为绘图添加滚动条,但只出现垂直滚动条,而不会出现水平滚动条。我在这里附上了一个带有最少元素的闪亮小应用程序来演示该问题。
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')
})
}
)
Run Code Online (Sandbox Code Playgroud)