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, ...)
c3 | c3 htmlwidget object |
---|---|
show | boolean show or hide tooltips |
grouped | boolean |
format | list with options:
|
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 |
c3
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; }')))