【发布时间】:2021-02-01 00:45:48
【问题描述】:
如果您在 R 工作室中运行此代码,您会发现 NULL 数据的绘图仍然是一大块白色。
data 为 NULL 时怎么不显示呢。
在其他图表中,大白板看起来并不那么好。
library(shiny)
server <- function(input, output) {
output$x = renderPlot(NULL)
}
ui <- fluidPage(
br(),
plotOutput("x"),
tags$head(tags$style(HTML("
body {
margin: 0;
font-family: helvetica, sans-serif;
background: #F2F0F0;
}
.shiny-plot-output{
max-width: 100%;
box-shadow: 0px 0px 6px #888;
margin-left: auto;
margin-right: auto;
}
")))
)
shinyApp(ui = ui, server = server)
【问题讨论】: