Learn R Programming

echarty (version 1.6.3)

ec.upd: Update option lists

Description

And improve readability by chaining commands after ec.init

Usage

ec.upd(wt, ...)

Arguments

wt

An echarty widget

...

R commands to update chart option lists

Details

ec.upd makes changes to chart elements already set by ec.init.
It should be always piped after ec.init.
All numerical indexes for series,visualMap,etc. are JS-counted (start at 0)
Replaces syntax
p <- ec.init(...)
p$x$opts$series <- ...
with
ec.init(...) |> # set or preset chart params
ec.upd({series <- ...}) # update params thru R commands

Examples

Run this code
Orange |> dplyr::group_by(Tree) |> 
ec.init(series.param= list(universalTransition= list(enabled=TRUE))) |>
ec.upd({ 
 series <- lapply(series, function(ss) { ss$groupId <- ss$name; ss })
})

Run the code above in your browser using DataLab