I'm reading up on using proxies to add new series to existing charts. For a specific graph, instead of adding brand new series, I'd like to emphasize a certain point on existing one, namely by changing color, let's say to red. I didn't manage to figure out how to do it. How can I change a chart's options in such a way?
Skeleton code:
library(shiny)
library(echarts4r)
df <- data.frame(
x = 1:5,
y = runif(n = 1:5, min = 50, max = 200)
)
ui <- fluidPage(
echarts4rOutput("chart"),
actionButton("changecolor", "Change color of third bar"),
actionButton("removecolor", "Remove color of third bar")
)
server <- function(input, output){
output$chart <- renderEcharts4r({
e_charts(df, x) |>
e_bar(y)
})
observeEvent(input$changecolor, {
echarts4rProxy("chart") # What now?
})
}
shinyApp(ui, server)