동적의 높이 조정 tabpanel 와 함께 작동하지 않습 올

0

질문

나는 대시보드를 만들과 함께 빛나고 사용하려면 올 내부 tabpanel. 하지만 높이는 패널의하지 않는 동적으로 조정하는 고도의 정보박스. 면 나는 통합 차트에서 위원회,그것은 자동으로 조정됩니다.

내 코드는 다음과 같습니다:

library("shiny")
library("shinydashboard")
library("shinydashboardPlus")

ui <- dashboardPage(
    header =     dashboardHeader()
    ,sidebar = dashboardSidebar()
    ,body = dashboardBody(
        
        tabBox(
            tabPanel(
                title = "Tab1"
                ,infoBoxOutput(outputId = "ibo")
            )
            ,tabPanel(
                title = "Tab2"
                ,plotOutput(outputId = "po")
            )
            ,width = 12
        )
        
    )
)

server <- function(input, output) {
    
    output$ibo <- renderInfoBox({
        infoBox(
            title = "Infobox"
            ,value = 42
        )
    })
    
    output$po <- renderPlot({
        plot(mtcars$mpg, mtcars$cyl)
    })
    
}

shinyApp(ui = ui, server = server)

는 방법을 조정할 수 있습니의 높이 tabpanel 의 높이로 올?

dashboard infobox r shiny
2021-11-22 13:58:11
1

최고의 응답

1

매우 쉽고,랩 infoBoxOutputfluidRow:

library("shiny")
library("shinydashboard")
library("shinydashboardPlus")

ui <- dashboardPage(
    header =     dashboardHeader()
    ,sidebar = dashboardSidebar()
    ,body = dashboardBody(
        
        tabBox(
            tabPanel(
                title = "Tab1",
                fluidRow(
                    infoBoxOutput(outputId = "ibo")
                )
            )
            ,tabPanel(
                title = "Tab2"
                ,plotOutput(outputId = "po")
            )
            ,width = 12
        )
        
    )
)

server <- function(input, output) {
    
    output$ibo <- renderInfoBox({
        infoBox(
            title = "Infobox"
            ,value = 42
        )
    })
    
    output$po <- renderPlot({
        plot(mtcars$mpg, mtcars$cyl)
    })
    
}

shinyApp(ui = ui, server = server)

enter image description here

2021-11-22 21:08:03

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................