给出shinydashboard
ui.R
library(shinydashboard)
library(shiny)
dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
valueBoxOutput(outputId = "vb")
)
)
server.R
library(shinydashboard)
library(shiny)
function(input, output, session) {
output$vb <- renderValueBox({
valueBox(subtitle = "Hello",
value = "hi",
width = 6,
color="blue"
)
})
}
问题
是否可以更改valueBox
的高度?
我尝试过使用tags
但是无法让它们工作,所以我显然错过了一些东西:
dashboardPage(
dashboardHeader(),
dashboardSidebar(
# tags$head(tags$style("#vb{height:500px}"))
),
dashboardBody(
# tags$head(tags$style("#vb{height:500px}")),
# div(style="height: 500px",
# valueBoxOutput(outputId = "vb")
# )
valueBoxOutput(outputId = "vb")
)
)
答案 0 :(得分:7)
事实证明我没有正确引用价值框;我需要使用.small-box
类:
dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
tags$head(tags$style(HTML(".small-box {height: 50px}"))),
valueBoxOutput(outputId = "vb")
)
)