examples.widgets.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. (function( $ ) {
  2. 'use strict';
  3. $(function() {
  4. /*
  5. Flot
  6. */
  7. var plot = $.plot('#flotWidgetsSales1', flotWidgetsSales1Data, {
  8. series: {
  9. lines: {
  10. show: true,
  11. lineWidth: 2
  12. },
  13. points: {
  14. show: true
  15. },
  16. shadowSize: 0
  17. },
  18. grid: {
  19. hoverable: true,
  20. clickable: true,
  21. borderColor: 'transparent',
  22. borderWidth: 1,
  23. labelMargin: 15,
  24. backgroundColor: 'transparent'
  25. },
  26. yaxis: {
  27. min: 0,
  28. color: 'transparent'
  29. },
  30. xaxis: {
  31. mode: 'categories',
  32. color: 'transparent'
  33. },
  34. legend: {
  35. show: false
  36. },
  37. tooltip: true,
  38. tooltipOpts: {
  39. content: '%x: %y',
  40. shifts: {
  41. x: -30,
  42. y: 25
  43. },
  44. defaultTheme: false
  45. }
  46. });
  47. /*
  48. Morris
  49. */
  50. Morris.Line({
  51. resize: true,
  52. element: 'morrisLine',
  53. data: morrisLineData,
  54. grid: false,
  55. xkey: 'y',
  56. ykeys: ['a'],
  57. labels: ['Series A'],
  58. hideHover: 'always',
  59. lineColors: ['#FFF'],
  60. gridTextColor: 'rgba(255,255,255,0.4)'
  61. });
  62. /*
  63. Sparkline: Bar
  64. */
  65. $("#sparklineBar").sparkline(sparklineBarData, {
  66. type: 'bar',
  67. width: '80',
  68. height: '50',
  69. barColor: '#0088cc',
  70. negBarColor: '#B20000'
  71. });
  72. $('.circular-bar-chart').appear();
  73. });
  74. }).apply(this, [ jQuery ]);