sparkline-demo.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. $(function () {
  2. $("#sparkline1").sparkline([34, 43, 43, 35, 44, 32, 44, 52, 25], {
  3. type: 'line',
  4. lineColor: '#17997f',
  5. fillColor: '#1ab394',
  6. });
  7. $("#sparkline2").sparkline([5, 6, 7, 2, 0, -4, -2, 4], {
  8. type: 'bar',
  9. barColor: '#1ab394',
  10. negBarColor: '#c6c6c6'});
  11. $("#sparkline3").sparkline([1, 1, 2], {
  12. type: 'pie',
  13. sliceColors: ['#1ab394', '#b3b3b3', '#e4f0fb']});
  14. $("#sparkline4").sparkline([34, 43, 43, 35, 44, 32, 15, 22, 46, 33, 86, 54, 73, 53, 12, 53, 23, 65, 23, 63, 53, 42, 34, 56, 76, 15, 54, 23, 44], {
  15. type: 'line',
  16. lineColor: '#17997f',
  17. fillColor: '#ffffff',
  18. });
  19. $("#sparkline5").sparkline([1, 1, 0, 1, -1, -1, 1, -1, 0, 0, 1, 1], {
  20. type: 'tristate',
  21. posBarColor: '#1ab394',
  22. negBarColor: '#bfbfbf'});
  23. $("#sparkline6").sparkline([4, 6, 7, 7, 4, 3, 2, 1, 4, 4, 5, 6, 3, 4, 5, 8, 7, 6, 9, 3, 2, 4, 1, 5, 6, 4, 3, 7, ], {
  24. type: 'discrete',
  25. lineColor: '#1ab394'});
  26. $("#sparkline7").sparkline([52, 12, 44], {
  27. type: 'pie',
  28. height: '150px',
  29. sliceColors: ['#1ab394', '#b3b3b3', '#e4f0fb']});
  30. $("#sparkline8").sparkline([5, 6, 7, 2, 0, 4, 2, 4, 5, 7, 2, 4, 12, 14, 4, 2, 14, 12, 7], {
  31. type: 'bar',
  32. barWidth: 8,
  33. height: '150px',
  34. barColor: '#1ab394',
  35. negBarColor: '#c6c6c6'});
  36. $("#sparkline9").sparkline([34, 43, 43, 35, 44, 32, 15, 22, 46, 33, 86, 54, 73, 53, 12, 53, 23, 65, 23, 63, 53, 42, 34, 56, 76, 15, 54, 23, 44], {
  37. type: 'line',
  38. lineWidth: 1,
  39. height: '150px',
  40. lineColor: '#17997f',
  41. fillColor: '#ffffff',
  42. });
  43. });