i want try produce composite sparklines in r. thought using html widgets might help:
library(htmlwidgets) library(sparkline) set.seed(1234) x = rnorm(10) y = rnorm(10) sparkline(x) sparkline(y)
in jquery sparkline function these packages use (http://omnipotent.net/jquery.sparkline/#s-about) 1 can pass parameters e.g. type='box'
.
to pass composite='true'
option requires 1 set id of class inside span linked javascript function caller. how can done in r? alternative suggestions drawing composite sparklines?
thanks @timelyportfolio raising issue , @ramnathv progressing updates adding composite function.
library(htmlwidgets) library(sparkline) sl1 <- sparkline( c(5,4,5,-2,0,3), type="bar", barcolor="blue", chartrangemin=-5, chartrangemax=10, # set id make easier refer in 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 composite spk_composite(sl1, sl2)