Given a 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"
)
})
}
Question
Is it possible to change the height of the valueBox
?
I've tried using tags
but can't get them to work so I'm obviously missing something:
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")
)
)
It turns out I wasn't referencing the value box correctly; I need to use the .small-box
class:
dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
tags$head(tags$style(HTML(".small-box {height: 50px}"))),
valueBoxOutput(outputId = "vb")
)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With