Gauge tooltip.

gauge_tooltip(g2, callback = NULL)

Arguments

g2

An object of class g2r as returned by g2r.

callback

A JavaScript callback function (see cb) which returns a color.

Examples

callback <- cb( "function(drat, qsec){ percent = qsec / 100 + '%'; return { name: drat, value: percent }; }" ) template <- '<li>{name}: {value}</li>' g2(mtcars, asp(mpg, qsec, tooltip = drat, tooltip = qsec, color = qsec)) %>% fig_point() %>% gauge_tooltip(callback) %>% conf_tooltip(itemTpl = template, showTitle = FALSE)