Description Usage Arguments See Also Examples
Add a TauCharts tooltip
1 | tau_tooltip(tau, fields = NULL, formatters = NULL)
|
tau |
taucharts object |
fields |
character vector of fields to display in the tooltip
(default is to use all columns in |
formatters |
a named list of options to format the tooltip values (see https://api.taucharts.com/plugins/tooltip.html) |
cars_data
dataset
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | data(cars_data)
tauchart(cars_data) %>%
tau_point("milespergallon", c("class", "price"), color="class") %>%
tau_tooltip(c("vehicle", "year", "class", "price", "milespergallon"))
tauchart(cars_data) %>%
tau_point("milespergallon", c("class", "price"), color="class") %>%
tau_tooltip(
fields = c("vehicle", "year", "class", "price", "milespergallon"),
formatters = list(
milespergallon = list(label = "Miles per Gallon"),
price = list(format = "3f"),
vehicle = list(format = htmlwidgets::JS(
"function(str) {
return str.toUpperCase();
}")
)
)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.