Description Usage Arguments Value Examples
nv stacked area plot
1 2 3 4 5 6 7 8 9 10 11 12 13 |
x |
a data frame with at least two columns whose first column contains numeric x-axis values and remaining columns contain stacked area y-axis values. |
nxticks |
number of x tick marks, set to 0 for none. |
xticklabels |
either a character-valued function of a single numeric value
that converts x-axis values to text, or a vector of labels as long as |
ytickformat |
format numeric tick labels using a d3.format string (d3.js) |
interpolate |
d3.js plot interpolation option |
controls |
(logical), if |
xlim |
an optional numeric vector of two values of lower and upper x-axis limits |
ylim |
an optional numeric vector of two values of lower and upper y-axis limits |
tooltip |
an optional character vector with as many entries as |
options |
optional additional JavaScript options passed directly to nvd3.js. |
An htmlwidget object that is displayed using the object's show or print method.
(If you don't see your widget plot, try printing it with the print
function.)
1 2 3 4 5 6 7 | data("stackedArea", package="nvd3")
head(stackedArea) # note POSIX date format in 1st column
nvd3(nvareaplot(stackedArea))
# Now plot with a better x-axis format:
nvd3(nvareaplot(stackedArea, xticklabels=function(x)
format(as.POSIXct(x, origin="1970-1-1"), "%Y-%m-%d")))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.