Description Usage Arguments See Also Examples
Customise aspects of the chart.
1 2 3 4 5 6 7 8 9 10 11 12 13 | gauge_color(g, ...)
gauge_size(g, ...)
gauge_shape(g, ...)
gauge_tooltip(g, ...)
gauge_label(g, ...)
gauge_style(g, ...)
gauge_interplay(g, ...)
|
g |
An object of class |
... |
Arguments to customise the gauge.
Generally, key value pairs of options, a vector of hex colors,
or a JavaScript function (wrapped in |
gauge to gauge aspects of the grid and axis.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # base plot
g <- g2(cars, asp(speed, dist)) %>%
fig_point(asp(color = speed))
# color with vector
g %>% gauge_color(c("red", "white", "blue"))
# color with callback
cb <- "function(speed){
if(speed > 10){
return 'blue';
}
return 'red';
}"
g %>% gauge_color(htmlwidgets::JS(cb))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.