Licitator 1.0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.6 KiB

5 years ago
  1.  // LINE AND BARS CHARTS
  2. $(function () {
  3. function generateNumber(min, max) {
  4. min = typeof min !== 'undefined' ? min : 1;
  5. max = typeof max !== 'undefined' ? max : 100;
  6. return Math.floor((Math.random() * max) + min);
  7. }
  8. var chart,
  9. categories = ['Categorie 1', 'Categorie 2', 'Categorie 3', 'Categorie 4', 'Categorie 5','Categorie 6', 'Categorie 7', 'Categorie 8', 'Categorie 9', 'Categorie 10', 'Categorie 11', 'Categorie 12', 'Categorie 13', 'Categorie 14', 'Categorie 15', 'Categorie 16', 'Categorie 17', 'Categorie 18', 'Categorie 19','Categorie 20', 'Categorie 21','Categorie 22', 'Categorie 23', 'Categorie 24', 'Categorie 25', 'Categorie 26', 'Categorie 27', 'Categorie 28', 'Categorie 29', 'Categorie 30'],
  10. serie1 = [13, 13, 46, 61, 23,12, 24, 16, 14, 12, 12, 24, 19, 13, 11, 11, 14, 11, 11, 11, 11, 13, 22, 10, 18, 15, 24, 31, 19, 10],
  11. serie2 = [52, 41, 58, 63, 55, 46, 45, 41, 38, 54, 50, 39, 48, 70, 63, 60, 58, 63, 83, 89, 83, 79, 83, 100, 104, 108, 52, 46, 83, 89],
  12. $aapls;
  13. $(document).ready(function() {
  14. chart = new Highcharts.Chart({
  15. chart: {
  16. renderTo: 'importantchart',
  17. type: 'column',
  18. backgroundColor: 'transparent',
  19. height: 140,
  20. marginLeft: 3,
  21. marginRight: 3,
  22. marginBottom: 0,
  23. marginTop: 0
  24. },
  25. title: {
  26. text: ''
  27. },
  28. xAxis: {
  29. lineWidth: 0,
  30. tickWidth: 0,
  31. labels: {
  32. enabled: false
  33. },
  34. categories: categories
  35. },
  36. yAxis: {
  37. labels: {
  38. enabled: false
  39. },
  40. gridLineWidth: 0,
  41. title: {
  42. text: null,
  43. },
  44. },
  45. series: [{
  46. name: 'Awesomness',
  47. data: serie1
  48. }, {
  49. name: 'More Awesomness',
  50. color: '#fff',
  51. type: 'line',
  52. data: serie2
  53. }],
  54. credits: {
  55. enabled: false
  56. },
  57. legend: {
  58. enabled: false
  59. },
  60. plotOptions: {
  61. column: {
  62. borderWidth: 0,
  63. color: '#b2c831',
  64. shadow: false
  65. },
  66. line: {
  67. marker: {
  68. enabled: false
  69. },
  70. lineWidth: 3
  71. }
  72. },
  73. tooltip: {
  74. enabled: false
  75. }
  76. });
  77. setInterval(function() {
  78. chart.series[0].addPoint(generateNumber(), true, true);
  79. chart.series[1].addPoint(generateNumber(50, 150), true, true);
  80. }, 1000);
  81. setInterval(function() {
  82. $('.info-aapl span').each(function(index, elem) {
  83. $(elem).animate({
  84. height: generateNumber(1, 40)
  85. });
  86. });
  87. }, 3000);
  88. });
  89. });