Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

e_dispatch_action_p

Dispatch Action


Description

Create your own proxies, essentially a wrapper around the action API.

Usage

e_dispatch_action_p(proxy, type, ...)

Arguments

proxy

An echarts4r proxy as returned by echarts4rProxy.

type

Type of action to dispatch, i.e.: highlight.

...

Named options.

Examples

## Not run: 

library(shiny)

ui <- fluidPage(
  fluidRow(
    column(8, echarts4rOutput("chart")),
    column(4, actionButton("zoom", "Zoom"))
  )
)

server <- function(input, output, session) {
  output$chart <- renderEcharts4r({
    cars %>%
      e_charts(speed) %>%
      e_scatter(dist) %>%
      e_datazoom()
  })

  observe({
    req(input$zoom)

    echarts4rProxy("chart") %>%
      e_dispatch_action_p("dataZoom", startValue = 1, endValue = 10)
  })
}

if (interactive()) {
  shinyApp(ui, server)
}

## End(Not run)

echarts4r

Create Interactive Graphs with 'Echarts JavaScript' Version 5

v0.4.0
Apache License (>= 2.0)
Authors
John Coene [aut, cre, cph], Wei Su [ctb], Helgasoft [ctb], Xianying Tan [ctb] (<https://orcid.org/0000-0002-6072-3521>)
Initial release
2021-03-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.