render echart from uploading a csv file

good night and thanks for reading me. I'm trying to make an app that will render you a graph from uploading a csv file to it, in which you can choose the variables to graph. The truth is I don't know what I'm doing wrong, since the app doesn't render the graph. Any ideas or suggestions?

The code is:

library(shiny)
library(echarts4r)

ui <- fluidPage(
  
  selectInput('mydropdown', label = 'Selección de variables', choices = 'Aún no hay variables a escoger'),
  selectInput('mydropdown1', label = 'Selección de variables', choices = 'Aún no hay variables a escoger'),
  fileInput('myfileinput', label = 'Archivo a usar', accept = c(".csv")),
  echarts4rOutput("plot")

)

   #Server
   server <- function(input, output, session) {
  
   observeEvent(input$myfileinput, {
    
    mytable <- read.csv(input$myfileinput$datapath)
    
    updateSelectInput(session, "mydropdown", label = "Select", choices = colnames(mytable))
    updateSelectInput(session, "mydropdown1", label = "Select", choices = colnames(mytable))
    
  })
  
  mytable <- renderEcharts4r({
    myfileinput |> 
      e_charts(input$mydropdown)  |> 
      e_line(input$mydropdown1)
  })
}
shinyApp(ui, server)

Should probably be

output$plot <- renderEcharts4r({
    mytable() |>

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.