Learn R Programming

echarty (version 1.6.6)

ec.inspect: Chart to JSON

Description

Convert chart to JSON string

Usage

ec.inspect(wt, target = "opts", ...)

Value

A JSON string, except when target is 'data' - then a character vector.

Arguments

wt

An echarty widget as returned by ec.init

target

type of resulting value:
'opts' - the htmlwidget options as JSON (default)
'full' - the entire htmlwidget as JSON
'data' - info about chart's embedded data (char vector)

...

Additional attributes to pass to toJSON
'file' - optional file name to save to when target='full'

Details

Must be invoked or chained as last command.
target='full' will export all JavaScript custom code, ready to be used on import.
See also ec.fromJson.

Examples

Run this code
# extract JSON
json <- cars |> ec.init() |> ec.inspect()
json

# get from JSON and modify plot
ec.fromJson(json) |> ec.theme('macarons')

Run the code above in your browser using DataLab