
f7Gauge creates a gauge instance.
updateF7Gauge updates a framework7 gauge from the server side.
f7Gauge(
id,
type = "circle",
value,
size = 200,
bgColor = "transparent",
borderBgColor = "#eeeeee",
borderColor = "#000000",
borderWidth = "10",
valueTextColor = "#000000",
valueFontSize = "31",
valueFontWeight = "500",
labelText = NULL,
labelTextColor = "#888888",
labelFontSize = "14",
labelFontWeight = "400"
)updateF7Gauge(
id,
value = NULL,
labelText = NULL,
size = NULL,
bgColor = NULL,
borderBgColor = NULL,
borderColor = NULL,
borderWidth = NULL,
valueTextColor = NULL,
valueFontSize = NULL,
valueFontWeight = NULL,
labelTextColor = NULL,
labelFontSize = NULL,
labelFontWeight = NULL,
session = shiny::getDefaultReactiveDomain()
)
Gauge id.
Gauge type. Can be "circle" or "semicircle". Default is "circle."
New value. Numeric between 0 and 100.
Generated SVG image size (in px). Default is 200.
Gauge background color. Can be any valid color string, e.g. #ff00ff, rgb(0,0,255), etc. Default is "transparent".
Main border/stroke background color.
Main border/stroke color.
Main border/stroke width.
Value text color.
Value text font size.
Value text font weight.
Gauge additional label text.
Label text color.
Label text font size.
Label text font weight.
Shiny session object.
# NOT RUN {
# Gauge
if(interactive()){
library(shiny)
library(shinyMobile)
shinyApp(
ui = f7Page(
title = "Gauges",
f7SingleLayout(
navbar = f7Navbar(title = "f7Gauge"),
f7Block(
f7Gauge(
id = "mygauge",
type = "semicircle",
value = 50,
borderColor = "#2196f3",
borderWidth = 10,
valueFontSize = 41,
valueTextColor = "#2196f3",
labelText = "amount of something"
)
)
)
),
server = function(input, output) {}
)
}
if (interactive()) {
library(shiny)
library(shinyMobile)
shinyApp(
ui = f7Page(
title = "Gauges",
f7SingleLayout(
navbar = f7Navbar(title = "update f7Gauge"),
f7Gauge(
id = "mygauge",
type = "semicircle",
value = 50,
borderColor = "#2196f3",
borderWidth = 10,
valueFontSize = 41,
valueTextColor = "#2196f3",
labelText = "amount of something"
),
f7Button("go", "Update Gauge")
)
),
server = function(input, output, session) {
observeEvent(input$go, {
updateF7Gauge(id = "mygauge", value = 75, labelText = "New label!")
})
}
)
}
# }
Run the code above in your browser using DataLab