callbacks {echarts4r}R Documentation

Callbacks

Description

Binds events to chart interactions.

Usage

e_on(e, query, handler, event = "click")

e_off(e, query, handler, event = "click")

Arguments

e

An echarts4r object as returned by e_charts or a proxy as returned by echarts4rProxy.

query

Condistion that triggers the handler

handler

JavaSscript handler, passed to JS.

event

Event that triggers the handler.

See Also

official documentation

Examples

cars |>
  e_charts(speed) |>
  e_scatter(dist) |>
  e_on(
    list(seriesName = "dist"),
    "function(){alert('Serie clicked')}"
  )

[Package echarts4r version 0.4.5 Index]