Customise aspects of the chart.
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.
# 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))