Skip to content

Instantly share code, notes, and snippets.

@helgasoft
Last active April 16, 2025 06:22
Show Gist options
  • Save helgasoft/e914fe6f4a9ed9407f78e41cb18b3aaa to your computer and use it in GitHub Desktop.
Save helgasoft/e914fe6f4a9ed9407f78e41cb18b3aaa to your computer and use it in GitHub Desktop.
echarty announcements and temporary notes
#' This gist is for echarty announcements and notes
#' Comments are temporary, periodically deleted.
#' If you like echarty, please consider granting a Github star ⭐.
library(echarty)
data.frame(x = seq.int(1, 5, 1),
y = seq.int(1, 10, 2)) |>
ec.init(
series.param= list(
type='line', symbolSize= 10,
lineStyle = list(opacity= 0.7),
itemStyle = list(opacity= 1),
areaStyle= list(color= 'red', opacity= 0.5))
)
@helgasoft
Copy link
Author

helgasoft commented Apr 16, 2025

@gacolitti, your toolbox JS example is correct.

as long as the toolbox is enabled in the chart options, the theme should be able to configure many of the options related to the toolbox.

Here is precisely that, done with echarty.

# json <- '{"color": ["green"], "backgroundColor": "lemonchiffon"}'
json <- '{
    "toolbox": {  "feature": { 
        "dataZoom": {  "yAxisIndex": "none"  },
        "restore": {}
     } }
}'
cars |> ec.init(toolbox= list(show=T)) |> ec.theme(name='bmine', code=json)

📌 If you like echarty, please consider granting a Github star ⭐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment