echarts4r comes with proxies (functions ending in _p) as well as the ability access selected data. You will find a demo of shiny working with echarts4r here.

Shiny Demo

A note if you are publishing on, if you have locally installed the development version of the package from Github with remotes as indicated on the homepage of the website please reinstall it devtools. Otherwise will intall the CRAN version which might lead to issues.

If you are using the Shiny Server, remember to install the package on the respective server with the following command:

# stable version
sudo su - -c "R -e \"install.packages('echarts4r', repos = '')\""
# dev version
sudo su - -c "R -e \"remotes::install_github('JohnCoene/echarts4r')\""


Get data from shiny with the following:

  • elementId + _brush - returns data on brushed data points.
  • elementId + _legend_change - returns series name of legend selected/unselected.
  • elementId + _clicked_data - returns data of clicked data point.
  • elementId + _clicked_data_value - returns value of clicked data point.
  • elementId + _clicked_row - returns row number of clicked data point.
  • elementId + _clicked_serie - returns name of serie of clicked data point.
  • elementId + _mouseover_data - returns data on hovered data point.
  • elementId + _mouseover_data_value - returns value of hovered data point.
  • elementId + _mouseover_row - returns row o hovered data point.
  • elementId + _mouseover_serie - returns name of serie of hovered data point.

If you want to implement a missing callback with e_distpatch_action_p.


Interact with the charts without redrawing (proxies):

  • e_append1_p and e_append2_p - to add data to your chart.
  • e_highlight_p and e_downplay_p - to highlight or downplay a serie.
  • e_showtip_p and e_hidetip_p - to Show or hide the tooltip.
  • e_draw_p to draw the chart, see function documentation for examples.
  • e_focus_adjacency and e_unfocus_adjacency - to focus or unfocus on adjacent nodes (networks).

See the example below and the various proxies documentation.


ui <- fluidPage(
  actionButton("add", "Add Data to y"),

server <- function(input, output, session){

  data <- data.frame(x = rnorm(10, 5, 3), y = rnorm(10, 50, 12), z = rnorm(10, 50, 5))
  react <- eventReactive(input$add, {
    set.seed(sample(1:1000, 1))
    data.frame(x = rnorm(10, 5, 2), y = rnorm(10, 50, 10))
  output$plot <- renderEcharts4r({
    data %>% 
     e_charts(x) %>% 
     e_scatter(y) %>%
     e_scatter(z) %>% 
     e_brush(throttleDelay = 1000)
  observeEvent(input$add, {
    echarts4rProxy("plot") %>% 
      e_append1_p(0, react(), x, y)
  output$selected <- renderPrint({

shinyApp(ui, server)


You can also show a spinner while shiny recalculates.

Without loading, chart redraws with neat animation.

With loading.