【问题标题】:Dashboard graph placement in ShinyShiny中的仪表板图形放置
【发布时间】:2021-04-03 01:23:00
【问题描述】:

我的 Shiny 仪表板页面由三个主要行组成。 我在前两行的图表工作正常。

但是说到第三行,我主要需要分成两列。 然后需要将第一列分为其他列,并将我的饼图放在一个列中,将单选按钮放在另一列中。

在第二个大栏中,我需要放置一些信息框。我尝试放置它,以下是与我的第三行相关的部分。但这对我不起作用。有人可以帮忙吗。

    fluidRow(
      column(width = 8,

           splitLayout(
             column(width = 10,
                plotOutput("PieVaccineByGender", height = "350px", width = "700px")
             ),
                      
             column(width = 2,
                radioButtons(
                  "Vaccine",
                  "Enable or disable Grouping:",
                  c("Age" = "Age" ,
                    "Region" = "Region"),
                  inline = F
                )
                
               )
            ), 
        
      ),
    
    column(width = 4,
           infoBoxOutput('VaccineCount')
           )
  )

以下是我的仪表板现在的样子。

【问题讨论】:

    标签: r shiny


    【解决方案1】:

    信息框显示不正确?试试width = 12

    为什么需要使用splitLayout?您可以直接在列内添加列

    见下文

    
    library(shinydashboard)
    library(shiny)
    shinyApp(
        ui = dashboardPage(
            dashboardHeader(),
            dashboardSidebar(),
            dashboardBody(
                fluidRow(
                    column(width = 8,
                           column(width = 10,
                                  plotOutput("PieVaccineByGender", height = "350px", width = "700px")
                           ),
                           
                           column(width = 2,
                                  radioButtons(
                                      "Vaccine",
                                      "Enable or disable Grouping:",
                                      c("Age" = "Age" ,
                                        "Region" = "Region"),
                                      inline = F
                                  )
                                  
                           )
                    ),
                    
                    column(width = 4,
                           shinydashboard::infoBox(title = "abc", value = "123", icon = icon("exclamation-triangle"), width = 12)
                    )
                )
            ),
            title = "Dashboard example"
        ),
        server = function(input, output) { output$PieVaccineByGender <- renderPlot(plot(1))}
    )
    
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-07
      • 2015-12-25
      • 2019-12-06
      • 1970-01-01
      • 2015-12-22
      • 1970-01-01
      • 2022-01-20
      • 2020-03-05
      相关资源
      最近更新 更多