Convert JSON string or file to chart
Arguments
- txt
Could be one of the following:
class url, likeurl('https://serv.us/cars.txt')
class file, likefile('c:/temp/cars.txt','rb')
class json, likeec.inspect(p)
, for options or full
class character, JSON string with options only, see example below- ...
Any attributes to pass to internal ec.init when txt is options only
Details
txt could be either a list of options (x$opts) to be set by setOption,
OR an entire htmlwidget generated thru ec.inspect with target='full'.
The latter imports all JavaScript functions defined by the user.
Examples
txt <- '{
"xAxis": { "data": ["Mon", "Tue", "Wed"]}, "yAxis": { },
"series": { "type": "line", "data": [150, 230, 224] } }'
ec.fromJson(txt) # text json
# outFile <- 'c:/temp/cars.json'
# cars |> ec.init() |> ec.inspect(target='full', file=outFile)
# ec.fromJson(file(outFile, 'rb'))
# ec.fromJson(url('http://localhost/echarty/cars.json'))
ec.fromJson('https://helgasoft.github.io/echarty/test/pfull.json')