canvasXpress.json | R Documentation |
Custom HTML widget creation function based on widget YAML and JavaScript for use in any html-compatible context using raw JSON input. Validation of data and configuration is deferred completely to the canvasXpress JavaScript library.
canvasXpress.json(
json,
pretty = FALSE,
digits = 4,
width = 600,
height = 400,
destroy = FALSE
)
json |
JSON string or object |
pretty |
print tagged code (JSON/HTML) nicely - default = FALSE |
digits |
display digits - default = 4 |
width |
plot width (valid CSS units) - default = 600px |
height |
plot height (valid CSS units) - default = 400px |
destroy |
used to indicate removal of a plot - default = FALSE |
For the formatting of the JSON input object see
**Note:** this function is intended for use by advanced users who are experimenting with or need to utilize the json-formatted input to canvasXpress and are comfortable debugging chart issues in a browser (JavaScript) context instead of in R.
htmlwidgets object
my_json <- '{ "data": {"y": { "vars": ["Performance"],
"smps": ["January"],
"data": [[85]] }},
"config": { "graphType": "Meter",
"meterType": "gauge" }}'
canvasXpress.json(my_json)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.