2017-06-15 64 views
0

我有幾個盒子,用戶輸入後會用圖表和表格填充。在shinydashboard body中切割背景顏色

因爲我已經改變了佈局是基於列的,背景顏色似乎是第一個框下被削減這樣的: enter image description here

我不知道爲什麼會這樣。

這裏是一個示例代碼重現佈局:

library(shiny) 
library(shinydashboard) 
sidebar <- dashboardSidebar(
    sidebarMenu(
    busyIndicator(text="Loading..."), 
    tags$head(
     tags$style(
     HTML(' 
      #uploadfile{height: 25px} 
      #rat{height: 25px; font-size: 10px} 
      #pnum{height: 25px; font-size: 10px} 
      #mytext{width: 50px} 
      .content-wrapper, 
      .right-side { 
      background-color: #EBE5D0; 
      } 
      li { cursor: pointer; cursor: hand; } 
      ') 
     ) 
     ), 
    menuItem("Network", icon = icon("table"), tabName = "network", badgeColor = "green") 
     ) 
    ) 

body <- dashboardBody(
    tabItems(
    tabItem(tabName = "network", 
      column(width = 2, 
        box(
         title="INPUT FILES",solidHeader = TRUE, status="primary", 
         fileInput('file1',"file 1", multiple=F,accep=".Rdata"), 
         fileInput('file2',"file 2", multiple=F,accep=".Rdata"), 
         fileInput('file3',"file 3", multiple=F,accep=".Rdata"), 
         fileInput('file4',"file 4", multiple=F,accep=".Rdata"), 
         uiOutput("phenoselect"), 
         uiOutput("phenolog"),     
         tags$div(align = 'left', 
           class = 'multicol', uiOutput("covarselect")), 
         uiOutput("snpPlotButton"), 
         height = 800, 
         width = NULL 
        ) 
      ), 
      column(width = 8, 
        box(
        title="PLOT",solidHeader = TRUE, status="primary", 
        plotOutput('plotSNPmaf',height="500px"), 
        height = 800, 
        width = NULL 
        ), 
        box(
        title="TABLE",solidHeader = TRUE, status="primary", 
        dataTableOutput("seqMetaGene"), 
        uiOutput("BoxPlotButton"), 
        width = NULL 
        ), 
        box(
        title="BOXPLOT",solidHeader = TRUE, status="primary", 
        plotOutput("boxplotSnps"), 
        width = NULL 
        ) 
      ) 
    ) 
)) 


ui<- dashboardPage(
    dashboardHeader(title = "Results"), 
    sidebar, 
    body 
) 


server <- function(input, output,session) {} 

shinyApp(ui = ui, server = server) 
+0

你試過嗎?身體{0} {0} {0}}餘量:0; 填充:0;最小高度:100%; } – tech2017

+0

謝謝,@ tech2017,我現在試過了,不幸的是我仍然得到相同的結果 – Bea

回答

1

您需要在fluidRow來包裝你column S,這樣它會工作。

這樣的:工作示例的

fluidRow(column(...), 
     column(...)) 

截圖: enter image description here

+0

它的工作,謝謝! – Bea