Modify plot elements that relate to tooltips. C3.js documentation contains an extended example.

tooltip(c3, show = TRUE, grouped = TRUE, format = NULL,
  position = NULL, contents = NULL, ...)

# S3 method for c3
tooltip(c3, show = TRUE, grouped = TRUE, format = NULL,
  position = NULL, contents = NULL, ...)

Arguments

c3

c3 htmlwidget object

show

boolean show or hide tooltips

grouped

boolean

format

list with options:

  • title: character js function, wrap character or character vector in JS()

  • name: character js function, wrap character or character vector in JS()

  • value: character js function, wrap character or character vector in JS()

position

character js function, wrap character or character vector in JS()

contents

character js function, wrap character or character vector in JS()

...

addition options passed to the tooltip object

Value

c3

See also

Examples

data <- data.frame(a = abs(rnorm(20) *10), b = abs(rnorm(20) *10), c = abs(rnorm(20) *10), d = abs(rnorm(20) *10)) data %>% c3() %>% tooltip(format = list(title = htmlwidgets::JS("function (x) { return 'Data ' + x; }"), name = htmlwidgets::JS('function (name, ratio, id, index)', ' { return name; }'), value = htmlwidgets::JS('function (value, ratio, id, index)', ' { return ratio; }')))