View source: R/html_functionality.R
cxHtmlPage | R Documentation |
This function creates and returns a stand-alone HTML page containing the given canvasXpress object. Width and height can be inferred from the canvasXpress object (default) or overridden for the page output.
cxHtmlPage(chartObject, width = NULL, height = NULL)
chartObject |
a canvasXpress plot object |
width |
plot width override for the HTML page (valid CSS units) - default = NULL |
height |
plot height override for the HTML page (valid CSS units) - default = NULL |
a character string containing a self-contained html page
## Not run:
my_chart <- canvasXpress(data = data.frame(Sample1 = c(33, 48),
Sample2 = c(44, 59),
Sample3 = c(55, 6)),
graphType = "Bar",
title = "Example Bar Chart",
width = "600px")
# create a page using the chart dimensions on my_chart
html_page <- cxHtmlPage(my_chart)
# or change the chart width/height for this page:
html_page <- cxHtmlPage(my_chart, width = "100%", height = "70vh")
# save page for viewing/sharing
writeLines(html_page, tempfile(fileext = ".html"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.