tau_tooltip: Add a TauCharts tooltip

Description Usage Arguments See Also Examples

Description

Add a TauCharts tooltip

Usage

1
tau_tooltip(tau, fields = NULL, formatters = NULL)

Arguments

tau

taucharts object

fields

character vector of fields to display in the tooltip (default is to use all columns in data)

formatters

a named list of options to format the tooltip values (see https://api.taucharts.com/plugins/tooltip.html)

See Also

cars_data dataset

Examples

 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();
        }")
      )
    )
 )

hrbrmstr/taucharts documentation built on May 17, 2019, 5:14 p.m.