title: Error with observeEvent and a plot created with echarts4r (shiny app)
body: <p>Hi and thanks for reading me</p>
  <p>Im working with a neural network model for time series in shiny. I want to create an app that generates a forecast after pressing a button, but it only stays loading and does not generate any graph (I already tried the script outside of a shiny app and it works correctly). Am I using the ObserveEvent wrong or is there something I am missing? thanks for your help</p>
  <p>The code (and data) is the following:</p>
  <pre><code>library(shiny)
  library(echarts4r)
  library(forecast)
  library(shinyWidgets)
  library(lubridate)
  
  datos &lt;- data.frame(
    Servicio = sample(c(&quot;Servicio 1&quot;, &quot;Servicio 2&quot;, &quot;Servicio 3&quot;), 162, replace = TRUE),
    Año_mes = seq(as.Date(&quot;1980-01-01&quot;), as.Date(&quot;2020-05-31&quot;), by = &quot;quarter&quot;),
    servs = rnorm(162, mean = 500)
  ) |&gt; 
    setNames(c(&quot;Servicio&quot;, &quot;Año_mes&quot;, &quot;Número de Servicios&quot;))
  
  datos1 &lt;- datos |&gt; 
    group_by(Año_mes, Servicio) |&gt; 
    summarise(total = sum(`Número de Servicios`)) 
  
  datos_select &lt;- datos |&gt; 
    group_by(Servicio) |&gt; 
    summarise(total = sum(datos$`Número de Servicios`))
  
  
  
  
  datos_select &lt;- datos_select$Servicio
  datos_select
  
  ui &lt;- fluidPage(
    column(
      width = 6,
      selectInput(&quot;var&quot;,
                  &quot;Escoge un servicio a modelar&quot;, choices = datos_select
      ),
      numericInput(&quot;rezagosnoest&quot;, &quot;Escoge un número de rezagos no estacionales:&quot;,1, min = -1000, max = 1000),
      numericInput(&quot;rezagossiest&quot;, &quot;Escoge un número de rezagos estacionales:&quot;,1, min = -1000, max = 1000),
      numericInput(&quot;neuronas&quot;, &quot;Escoge la cantidad de neuronas usadas para el cálculo:&quot;,1, min = 1, max = 1000),
      numericInput(&quot;futuros&quot;, &quot;Escoge el número de periodos (meses) a pronosticar:&quot;,1, min = 1, max = 1000),
      actionBttn(
        inputId = &quot;modelar&quot;,
        label = &quot;Generar pronóstico&quot;, 
        style = &quot;bordered&quot;,
        color = &quot;success&quot;,
        icon = icon(&quot;sliders&quot;)
      )),
    column(width = 6,
           addSpinner(echarts4rOutput(&quot;grafico&quot;), spin = &quot;folding-cube&quot;, color = &quot;#4DAF4A&quot;))
  )
  
  
  server &lt;- function(input, output){
    
    observeEvent(
      input$modelar,{
        reactive({
          
          filtrado &lt;- datos1 |&gt; 
            filter(Servicio == input$var) 
          temporal &lt;- ts(filtrado$total, start = 2017, frequency = 12)
          set.seed(50)
          modelo &lt;- nnetar(temporal, p=input$rezagossiest,P=input$rezagosnoest,
                           size=input$neuronas)
          nnetforecast &lt;- forecast(modelo, h = input$futuros, PI = T)
          df_inf &lt;- data.frame(nnetforecast$lower)
          df_sup &lt;- data.frame(nnetforecast$upper)
          df_forecast &lt;- data.frame(nnetforecast$mean, df_sup$X90., df_inf$X10.) |&gt; 
            setNames( c(&quot;Pronostico&quot;, &quot;Banda superior&quot;, &quot;Banda inferior&quot;) )
          filtrado1 &lt;- bind_rows(filtrado, df_forecast)
          filtrado2 &lt;- data.frame(
            Fecha = seq(as.Date(datos1$Año_mes[1]), (as.Date(tail(datos1$Año_mes, 1))+ months(input$futuros)), by = &quot;month&quot;),
            filtrado1$total, filtrado1$Pronostico, filtrado1$`Banda superior`, filtrado1$`Banda inferior`
          ) |&gt; 
            setNames(c(&quot;Fecha&quot;, &quot;Valor&quot;, &quot;pronostico&quot;, &quot;Banda superior&quot;, &quot;Banda inferior&quot;))
          
          output$grafico &lt;- renderEcharts4r({
            
            filtrado2 |&gt; 
              e_charts(Fecha) |&gt; 
              e_line(Valor, symbol = &quot;none&quot;) |&gt; 
              e_line(pronostico, symbol = &quot;none&quot;) |&gt; 
              #e_y_axis(min = 30000, max = 71000) |&gt; 
              e_tooltip(trigger = &quot;axis&quot;) |&gt; 
              e_band(min = `Banda inferior`, max = `Banda superior`) |&gt; 
              e_color(color = c(&quot;#4065a1&quot;, &quot;#a14040&quot;, &quot;#d6c847&quot;, &quot;#d6c847&quot;) ) 
            
          })
          
        })
        
      }
      
      
    )
    
  }
  
  shinyApp(ui, server)
  </code></pre>