How to add more Whitespace to the Main Panel in Shiny Dashboard?

白昼怎懂夜的黑 提交于 2019-12-10 14:11:32

问题


I have a couple of charts in my Main Panel in my Shiny Dashboard, and I was wondering how to extend the whitespace at the bottom of the main panel? How should I modify my ui.R to do this?

dashboardBody(
    tabItems(
      tabItem("dashboard",

              mainPanel(
                showOutput("plot3", "Nvd3"),
                showOutput("plot4", "Nvd3")

         )),

Update: Adding HTML("<br><br><br>") in the Main Panel only created a wider dark panel:


回答1:


Use CSS, in your ui.R file add:

tags$head(
   tags$style(
       HTML("#dashboard{margin-bottom:50px;}")
   )
)



回答2:


Can you try to wrap you showOutput with a div wrap?

tags$div(
  style="margin-bottom:50px;",
  showOutput("plot4", "Nvd3")
)



回答3:


I had the same problem. Putting everything in a fluidRow() fixed it for me...




回答4:


For vertical whitespace in Shiny, you can go with headerPanel("")




回答5:


I had the same problem and according to tip Jthorpe I removed all mainPanelfrom my script. I have six plots one by one verticaly and it works fine.



来源:https://stackoverflow.com/questions/33266157/how-to-add-more-whitespace-to-the-main-panel-in-shiny-dashboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!