sparklines-demo.js 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. /* Sparklines charts */
  2. $(function() {
  3. "use strict";
  4. $('.sparkbar').sparkline('html', {
  5. type: 'bar',
  6. disableHiddenCheck: false,
  7. width: '36px',
  8. height: '36px'
  9. });
  10. });
  11. /* Sparklines */
  12. $(function() {
  13. "use strict";
  14. $('.bar-sparkline-btn').sparkline([
  15. [3, 5],
  16. [4, 7],
  17. [2, 5],
  18. [3, 5],
  19. [4, 7],
  20. [4, 7],
  21. [5, 7],
  22. [2, 7],
  23. [3, 5]
  24. ], {
  25. type: 'bar',
  26. height: '53px',
  27. barWidth: '5px',
  28. barSpacing: '2px'
  29. });
  30. });
  31. $(function() {
  32. "use strict";
  33. $('.bar-sparkline-btn-2').sparkline([
  34. [3, 5],
  35. [4, 7],
  36. [2, 5],
  37. [3, 5],
  38. [4, 7],
  39. [4, 7],
  40. [5, 7],
  41. [2, 7],
  42. [3, 5]
  43. ], {
  44. type: 'bar',
  45. height: '40px',
  46. barWidth: '3px',
  47. barSpacing: '2px'
  48. });
  49. });
  50. $(function() {
  51. "use strict";
  52. $('.bar-sparkline').sparkline([
  53. [4, 8],
  54. [2, 7],
  55. [2, 6],
  56. [2, 7],
  57. [3, 5],
  58. [2, 7],
  59. [2, 6],
  60. [2, 7],
  61. [3, 5],
  62. [4, 7],
  63. [2, 5],
  64. [3, 5],
  65. [4, 7],
  66. [4, 7],
  67. [5, 7],
  68. [4, 8],
  69. [2, 7],
  70. [2, 6],
  71. [2, 7],
  72. [3, 5]
  73. ], {
  74. type: 'bar',
  75. height: '35px',
  76. barWidth: '5px',
  77. barSpacing: '2px'
  78. });
  79. });
  80. $(function() {
  81. "use strict";
  82. $('.bar-sparkline-2').sparkline('html', {
  83. type: 'bar',
  84. barColor: 'black',
  85. height: '35px',
  86. barWidth: '5px',
  87. barSpacing: '2px'
  88. });
  89. });
  90. $(function() {
  91. "use strict";
  92. $('.tristate-sparkline').sparkline('html', {
  93. type: 'tristate',
  94. barColor: 'black',
  95. height: '35px',
  96. barWidth: '5px',
  97. barSpacing: '2px'
  98. });
  99. });
  100. $(function() {
  101. "use strict";
  102. $('.discrete-sparkline').sparkline('html', {
  103. type: 'discrete',
  104. barColor: 'black',
  105. height: '45px',
  106. barSpacing: '4px'
  107. });
  108. });
  109. $(function() {
  110. "use strict";
  111. $('.pie-sparkline').sparkline('html', {
  112. type: 'pie',
  113. barColor: 'black',
  114. height: '45px',
  115. width: '45px'
  116. });
  117. });
  118. $(function() {
  119. "use strict";
  120. $(".pie-sparkline-alt").sparkline('html', {
  121. type: 'pie',
  122. width: '100',
  123. height: '100',
  124. sliceColors: ['#EFEFEF', '#5BCCF6', '#FA7753'],
  125. borderWidth: 0
  126. });
  127. });
  128. $(function() {
  129. "use strict";
  130. var myvalues = [10, 8, 5, 7, 4, 4, 1];
  131. $('.dynamic-sparkline').sparkline(myvalues, {
  132. height: '35px',
  133. width: '135px'
  134. });
  135. });
  136. $(function() {
  137. "use strict";
  138. var myvalues = [10, 8, 5, 7, 4, 4, 1];
  139. $('.dynamic-sparkline-5').sparkline(myvalues, {
  140. height: '57px',
  141. width: '100px'
  142. });
  143. });
  144. $(function() {
  145. "use strict";
  146. $('.tristate-sparkline-2').sparkline('html', {
  147. type: 'tristate',
  148. posBarColor: '#ec6a00',
  149. negBarColor: '#ffc98a',
  150. zeroBarColor: '#000000',
  151. height: '35px',
  152. barWidth: '5px',
  153. barSpacing: '2px'
  154. });
  155. });
  156. $(function() {
  157. "use strict";
  158. $(".infobox-sparkline").sparkline([
  159. [3, 5],
  160. [4, 7],
  161. [2, 5],
  162. [3, 5],
  163. [4, 7],
  164. [4, 7],
  165. [5, 7],
  166. [2, 7],
  167. [3, 5]
  168. ], {
  169. type: 'bar',
  170. height: '53',
  171. barWidth: 5,
  172. barSpacing: 2,
  173. zeroAxis: false,
  174. barColor: '#ccc',
  175. negBarColor: '#ddd',
  176. zeroColor: '#ccc',
  177. stackedBarColor: ['#871010', '#ffebeb']
  178. });
  179. });
  180. $(function() {
  181. "use strict";
  182. $(".infobox-sparkline-2").sparkline([
  183. [3, 5],
  184. [4, 7],
  185. [2, 5],
  186. [3, 5],
  187. [4, 7],
  188. [4, 7],
  189. [5, 7],
  190. [2, 7],
  191. [3, 5]
  192. ], {
  193. type: 'bar',
  194. height: '53',
  195. barWidth: 5,
  196. barSpacing: 2,
  197. zeroAxis: false,
  198. barColor: '#ccc',
  199. negBarColor: '#ddd',
  200. zeroColor: '#ccc',
  201. stackedBarColor: ['#000000', '#cccccc']
  202. });
  203. });
  204. $(function() {
  205. "use strict";
  206. $(".infobox-sparkline-pie").sparkline([1.5, 2.5, 2], {
  207. type: 'pie',
  208. width: '57',
  209. height: '57',
  210. sliceColors: ['#0d4f26', '#00712b', '#2eee76'],
  211. offset: 0,
  212. borderWidth: 0,
  213. borderColor: '#000000'
  214. });
  215. });
  216. $(function() {
  217. "use strict";
  218. $(".infobox-sparkline-tri").sparkline([1, 1, 0, 1, -1, -1, 1, -1, 0, 0, 2, 1], {
  219. type: 'tristate',
  220. height: '53',
  221. posBarColor: '#1bb1fc',
  222. negBarColor: '#3d57ed',
  223. zeroBarColor: '#000000',
  224. barWidth: 5
  225. });
  226. });
  227. $(function() {
  228. "use strict";
  229. $(".sprk-1").sparkline('html', {
  230. type: 'line',
  231. width: '50%',
  232. height: '65',
  233. lineColor: '#b2b2b2',
  234. fillColor: '#ffffff',
  235. lineWidth: 1,
  236. spotColor: '#0065ff',
  237. minSpotColor: '#0065ff',
  238. maxSpotColor: '#0065ff',
  239. spotRadius: 4
  240. });
  241. });
  242. $(function() {
  243. "use strict";
  244. $(".sparkline-big").sparkline('html', {
  245. type: 'line',
  246. width: '85%',
  247. height: '80',
  248. highlightLineColor: '#ffffff',
  249. lineColor: '#ffffff',
  250. fillColor: 'transparent',
  251. lineWidth: 1,
  252. spotColor: '#ffffff',
  253. minSpotColor: '#ffffff',
  254. maxSpotColor: '#ffffff',
  255. highlightSpotColor: '#000000',
  256. spotRadius: 4
  257. });
  258. });
  259. $(function() {
  260. "use strict";
  261. $(".sparkline-big-alt").sparkline('html', {
  262. type: 'line',
  263. width: '90%',
  264. height: '110',
  265. highlightLineColor: '#accfff',
  266. lineColor: 'rgba(0,0,0,0.1)',
  267. fillColor: '#fcfeff',
  268. lineWidth: 1,
  269. spotColor: 'transparent',
  270. minSpotColor: 'transparent',
  271. maxSpotColor: 'transparent',
  272. highlightSpotColor: '#65a6ff',
  273. spotRadius: 6
  274. });
  275. });
  276. $(function() {
  277. "use strict";
  278. $(".sparkline-bar-big").sparkline('html', {
  279. type: 'bar',
  280. width: '85%',
  281. height: '90',
  282. barWidth: 6,
  283. barSpacing: 2,
  284. zeroAxis: false,
  285. barColor: '#ffffff',
  286. negBarColor: '#ffffff'
  287. });
  288. });
  289. $(function() {
  290. "use strict";
  291. $(".sparkline-bar-big-color").sparkline('html', {
  292. type: 'bar',
  293. height: '90',
  294. width: '85%',
  295. barWidth: 6,
  296. barSpacing: 2,
  297. zeroAxis: false,
  298. barColor: '#9CD159',
  299. negBarColor: '#9CD159'
  300. });
  301. });
  302. $(function() {
  303. "use strict";
  304. $(".sparkline-bar-big-color-2").sparkline([405, 450, 302, 405, 230, 311, 405, 342, 579, 405, 450, 302, 183, 579, 180, 311, 405, 342, 579, 405, 450, 302, 405, 230, 311, 405, 342, 579, 405, 450, 302, 405, 342, 432, 405, 450, 302, 183, 579, 180, 311, 405, 342, 579, 183, 579, 180, 311, 405, 342, 579, 405, 450, 302, 405, 230, 311, 405, 342, 579, 405, 450, 302, 405, 342, 432, 405, 450, 302, 183, 579, 180, 311, 405, 342, 579, 240, 180, 311, 450, 302, 370, 210], {
  305. type: 'bar',
  306. height: '88',
  307. width: '85%',
  308. barWidth: 6,
  309. barSpacing: 2,
  310. zeroAxis: false,
  311. barColor: '#9CD159',
  312. negBarColor: '#9CD159'
  313. });
  314. });