library("htmlwidgets") library("sparkline") set.seed(3) x = signif(rnorm(10), 2) y = signif(rnorm(10), 2)
A sparkline is a very small line chart r sparkline(cumsum(x))
. They are typically drawn without axes or coordinates.
The graph presents the general shape of the variation (typically over time) in some
measurement: r sparkline(x, type = 'bar')
. Sparklines are small enough to be
embedded in text r sparkline(abs(x), type = 'bar')
. They are often included within tables
Bar charts negative values:
| Object | Sparkline | Boxplot
|-------|-------------------|--------
| x
| r sparkline(x)
| r sparkline(x, type ='box')
| y
| r sparkline(y)
| r sparkline(y, type ='box')
You can install the developmental version using
devtools::install_github("htmlwidgets/sparkline")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.