v_event {vchartr} | R Documentation |
VChart events
Description
VChart events
Usage
v_event(vc, name, params, fun, ...)
Arguments
vc |
A chart initialized with |
name |
Name of the event, e.g. |
params |
Parameters to specifically monitor events in a certain part of the chart. |
fun |
JavaScript function executed when the event occurs. |
... |
Not used. |
Value
A vchart()
htmlwidget
object.
Examples
library(vchartr)
vchart(top_generation) %>%
v_bar(aes(country, electricity_generation)) %>%
v_event(
name = "click",
params = list(level = "mark", type = "bar"),
fun = JS(
"e => {",
" console.log(e);",
" alert(e.datum.x);",
"}"
)
)
[Package vchartr version 0.1.4 Index]