Description Usage Arguments Value Examples
Add a Composite to an Existing Sparkline
1 | spk_composite(sparkline = NULL, sparklineToAdd = NULL, ...)
|
sparkline |
|
sparklineToAdd |
|
... |
extra arguments to modify |
sparkline
object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | library(sparkline)
sl1 <- sparkline(
c(5,4,5,-2,0,3),
type='bar',
barColor="#aaf",
chartRangeMin=-5,
chartRangeMax=10,
# set an id that will make it easier to refer
# in the next sparkline
elementId="sparkline-for-composite"
)
sl2 <- sparkline(
c(4,1,5,7,9,9,8,7,6,6,4,7,8,4,3,2,2,5,6,7),
type="line",
fillColor = FALSE,
lineColor ='red',
chartRangeMin = -5,
chartRangeMax = 10
)
# add sparkline as a composite
spk_composite(sl1, sl2)
# add values and options as a composite
spk_composite(
sl1,
values=c(4,1,5,7,9,9,8,7,6,6,4,7,8,4,3,2,2,5,6,7),
options = list(
type="line",
fillColor = FALSE,
lineColor ='red',
chartRangeMin = -5,
chartRangeMax = 10
)
)
# add combination of sparkline and options as a composite
spk_composite(
sl1,
sl2,
options = list(
type="box"
)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.