e_inspect | R Documentation |
Get JSON options from an echarts4r object and build one from JSON.
e_inspect(e, json = FALSE, ...)
echarts_from_json(txt)
e |
An |
json |
Whether to return the JSON, otherwise returns a |
... |
Additional options to pass to toJSON. |
txt |
JSON character string, url, or file. |
txt
should contain the full list of options required to build a chart.
This is subsequently passed to the setOption
ECharts (JavaScript) function.
e_inspect
Returns a list
if json
is FALSE
and a
JSON string otherwise. echarts_from_json
returns an object of class echarts4r
.
Must be passed as last option.
p <- cars |>
e_charts(dist) |>
e_scatter(speed, symbol_size = 10)
p # plot
# extract the JSON
json <- p |>
e_inspect(
json = TRUE,
pretty = TRUE
)
# print json
json
# rebuild plot
echarts_from_json(json) |>
e_theme("dark") # modify
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.