e_remove {echarts4r} | R Documentation |
Remove Serie
Description
Remove a serie by name or precising its index.
Usage
e_remove_serie_p(proxy, serie_name = NULL, serie_index = NULL)
e_remove_serie(proxy, serie_name = NULL, serie_index = NULL)
Arguments
proxy |
An echarts4r proxy as returned by |
serie_name |
Name of serie to remove. |
serie_index |
Index of serie to append to (starts from 0). |
Examples
library(shiny)
ui <- fluidPage(
actionButton("rm", "Remove z serie"),
echarts4rOutput("plot")
)
server <- function(input, output, session) {
data <- data.frame(
x = rnorm(10, 5, 3),
y = rnorm(10, 50, 12),
z = rnorm(10, 50, 5)
)
output$plot <- renderEcharts4r({
data |>
e_charts(x) |>
e_scatter(y) |>
e_scatter(z)
})
observeEvent(input$rm, {
echarts4rProxy("plot") |>
e_remove_serie_p(serie_name = "z")
})
}
## Not run:
shinyApp(ui, server)
## End(Not run)
[Package echarts4r version 0.4.5 Index]