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.

132 lines
4.4 KiB

9 years ago
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>Highcharts Example</title>
  6. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
  7. <style type="text/css">
  8. ${demo.css}
  9. </style>
  10. <script type="text/javascript">
  11. $(function () {
  12. $('#container').highcharts({
  13. chart: {
  14. type: 'spline'
  15. },
  16. title: {
  17. text: 'Snow depth at Vikjafjellet, Norway'
  18. },
  19. subtitle: {
  20. text: 'Irregular time data in Highcharts JS'
  21. },
  22. xAxis: {
  23. type: 'datetime',
  24. dateTimeLabelFormats: { // don't display the dummy year
  25. month: '%e. %b',
  26. year: '%b'
  27. },
  28. title: {
  29. text: 'Date'
  30. }
  31. },
  32. yAxis: {
  33. title: {
  34. text: 'Snow depth (m)'
  35. },
  36. min: 0
  37. },
  38. tooltip: {
  39. headerFormat: '<b>{series.name}</b><br>',
  40. pointFormat: '{point.x:%e. %b}: {point.y:.2f} m'
  41. },
  42. plotOptions: {
  43. spline: {
  44. marker: {
  45. enabled: true
  46. }
  47. }
  48. },
  49. series: [{
  50. name: "Winter 2012-2013",
  51. // Define the data points. All series have a dummy year
  52. // of 1970/71 in order to be compared on the same x axis. Note
  53. // that in JavaScript, months start at 0 for January, 1 for February etc.
  54. data: [
  55. [Date.UTC(1970, 9, 21), 0],
  56. [Date.UTC(1970, 10, 4), 0.28],
  57. [Date.UTC(1970, 10, 9), 0.25],
  58. [Date.UTC(1970, 10, 27), 0.2],
  59. [Date.UTC(1970, 11, 2), 0.28],
  60. [Date.UTC(1970, 11, 26), 0.28],
  61. [Date.UTC(1970, 11, 29), 0.47],
  62. [Date.UTC(1971, 0, 11), 0.79],
  63. [Date.UTC(1971, 0, 26), 0.72],
  64. [Date.UTC(1971, 1, 3), 1.02],
  65. [Date.UTC(1971, 1, 11), 1.12],
  66. [Date.UTC(1971, 1, 25), 1.2],
  67. [Date.UTC(1971, 2, 11), 1.18],
  68. [Date.UTC(1971, 3, 11), 1.19],
  69. [Date.UTC(1971, 4, 1), 1.85],
  70. [Date.UTC(1971, 4, 5), 2.22],
  71. [Date.UTC(1971, 4, 19), 1.15],
  72. [Date.UTC(1971, 5, 3), 0]
  73. ]
  74. }, {
  75. name: "Winter 2013-2014",
  76. data: [
  77. [Date.UTC(1970, 9, 29), 0],
  78. [Date.UTC(1970, 10, 9), 0.4],
  79. [Date.UTC(1970, 11, 1), 0.25],
  80. [Date.UTC(1971, 0, 1), 1.66],
  81. [Date.UTC(1971, 0, 10), 1.8],
  82. [Date.UTC(1971, 1, 19), 1.76],
  83. [Date.UTC(1971, 2, 25), 2.62],
  84. [Date.UTC(1971, 3, 19), 2.41],
  85. [Date.UTC(1971, 3, 30), 2.05],
  86. [Date.UTC(1971, 4, 14), 1.7],
  87. [Date.UTC(1971, 4, 24), 1.1],
  88. [Date.UTC(1971, 5, 10), 0]
  89. ]
  90. }, {
  91. name: "Winter 2014-2015",
  92. data: [
  93. [Date.UTC(1970, 10, 25), 0],
  94. [Date.UTC(1970, 11, 6), 0.25],
  95. [Date.UTC(1970, 11, 20), 1.41],
  96. [Date.UTC(1970, 11, 25), 1.64],
  97. [Date.UTC(1971, 0, 4), 1.6],
  98. [Date.UTC(1971, 0, 17), 2.55],
  99. [Date.UTC(1971, 0, 24), 2.62],
  100. [Date.UTC(1971, 1, 4), 2.5],
  101. [Date.UTC(1971, 1, 14), 2.42],
  102. [Date.UTC(1971, 2, 6), 2.74],
  103. [Date.UTC(1971, 2, 14), 2.62],
  104. [Date.UTC(1971, 2, 24), 2.6],
  105. [Date.UTC(1971, 3, 2), 2.81],
  106. [Date.UTC(1971, 3, 12), 2.63],
  107. [Date.UTC(1971, 3, 28), 2.77],
  108. [Date.UTC(1971, 4, 5), 2.68],
  109. [Date.UTC(1971, 4, 10), 2.56],
  110. [Date.UTC(1971, 4, 15), 2.39],
  111. [Date.UTC(1971, 4, 20), 2.3],
  112. [Date.UTC(1971, 5, 5), 2],
  113. [Date.UTC(1971, 5, 10), 1.85],
  114. [Date.UTC(1971, 5, 15), 1.49],
  115. [Date.UTC(1971, 5, 23), 1.08]
  116. ]
  117. }]
  118. });
  119. });
  120. </script>
  121. </head>
  122. <body>
  123. <script src="../../js/highcharts.js"></script>
  124. <script src="../../js/modules/exporting.js"></script>
  125. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  126. </body>
  127. </html>