7

Is there a way that i can make a flexdashboard gauge bigger in my shiny app?

I have tried to change the width and height in the UI but that just moves it around on the dashboard. It doesn't make it bigger.

library(shiny)
library(flexdashboard)

fluidRow(column(
         width =  12,
           gaugeOutput('Scale', width = "800px", height = "400px")
       )
)
Sylhare
  • 5,907
  • 8
  • 64
  • 80
MoKG
  • 266
  • 3
  • 13

1 Answers1

5

Do you mean something like this?

Just using some simple css.

library(shiny)
library(flexdashboard)

css <- HTML("
.html-widget.gauge svg {
  height: 400px;
  width: 800px;
}")

ui <- fluidPage(
  tags$head(tags$style(css)),
  fluidRow(column(
    width =  12,
    gaugeOutput('Scale')
  )
  )
)

server <- function(input, output, session) {
  output$Scale <- renderGauge({
    gauge(56, min = 0, max = 100, symbol = '%', label = paste("Test Label"),gaugeSectors(
      success = c(100, 6), warning = c(5,1), danger = c(0, 1), colors = c("#CC6699")
    ))
  })
}

shinyApp(ui, server)
SeGa
  • 9,454
  • 3
  • 31
  • 70