Appends custom JavaScript to a highchart object via
chart.events.<where>. Use this for hand-written callbacks and plugins.
For Highcharts built-in modules (accessibility, exporting, etc.) use
highcharter::hc_add_dependency() instead.
Usage
hd_add_js(
hc,
code = NULL,
file = NULL,
plugin = NULL,
where = c("load", "render")
)Examples
if (interactive()) {
spec <- hd_spec(mtcars, "wt", "mpg")
fig <- hd_make(spec, "scatter")
fig <- hd_add_js(fig, code = "console.log('chart loaded');")
}
