bauge(45)
bauge(67, colors = "#F6C600")
bauge(90, full_circle = TRUE)
bauge(90, max = 210, gauge_width = 20, label_format = suffix(" km/h"))
# Shiny example
if (interactive()) {
library(shiny)
ui <- fluidPage(
baugeOutput(outputId = "gauge", width = "300px"),
actionButton(inputId = "update_value", label = "Update value"),
actionButton(inputId = "update_max", label = "Update max")
)
server <- function(input, output, session) {
value <- reactive({
input$update_value
round(sample.int(100, 1))
})
max_value <- reactive({
input$update_max
sample(100:200, 1)
})
output$gauge <- renderBauge({
bauge(
value = value(),
max = max_value(),
steps = c(30, 60, 90, 100),
colors = c("#FF0000", "#F97600", "#F6C600", "#60B044")
)
})
}
shinyApp(ui, server)
}
Run the code above in your browser using DataLab