index.htm 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. <script type="text/javascript">
  8. $(function () {
  9. $('#container').highcharts({
  10. chart: {
  11. zoomType: 'xy'
  12. },
  13. title: {
  14. text: 'Average Monthly Weather Data for Tokyo'
  15. },
  16. subtitle: {
  17. text: 'Source: WorldClimate.com'
  18. },
  19. xAxis: [{
  20. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  21. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  22. }],
  23. yAxis: [{ // Primary yAxis
  24. labels: {
  25. formatter: function() {
  26. return this.value +'°C';
  27. },
  28. style: {
  29. color: '#89A54E'
  30. }
  31. },
  32. title: {
  33. text: 'Temperature',
  34. style: {
  35. color: '#89A54E'
  36. }
  37. },
  38. opposite: true
  39. }, { // Secondary yAxis
  40. gridLineWidth: 0,
  41. title: {
  42. text: 'Rainfall',
  43. style: {
  44. color: '#4572A7'
  45. }
  46. },
  47. labels: {
  48. formatter: function() {
  49. return this.value +' mm';
  50. },
  51. style: {
  52. color: '#4572A7'
  53. }
  54. }
  55. }, { // Tertiary yAxis
  56. gridLineWidth: 0,
  57. title: {
  58. text: 'Sea-Level Pressure',
  59. style: {
  60. color: '#AA4643'
  61. }
  62. },
  63. labels: {
  64. formatter: function() {
  65. return this.value +' mb';
  66. },
  67. style: {
  68. color: '#AA4643'
  69. }
  70. },
  71. opposite: true
  72. }],
  73. tooltip: {
  74. shared: true
  75. },
  76. legend: {
  77. layout: 'vertical',
  78. align: 'left',
  79. x: 120,
  80. verticalAlign: 'top',
  81. y: 80,
  82. floating: true,
  83. backgroundColor: '#FFFFFF'
  84. },
  85. series: [{
  86. name: 'Rainfall',
  87. color: '#4572A7',
  88. type: 'column',
  89. yAxis: 1,
  90. data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
  91. tooltip: {
  92. valueSuffix: ' mm'
  93. }
  94. }, {
  95. name: 'Sea-Level Pressure',
  96. type: 'spline',
  97. color: '#AA4643',
  98. yAxis: 2,
  99. data: [1016, 1016, 1015.9, 1015.5, 1012.3, 1009.5, 1009.6, 1010.2, 1013.1, 1016.9, 1018.2, 1016.7],
  100. marker: {
  101. enabled: false
  102. },
  103. dashStyle: 'shortdot',
  104. tooltip: {
  105. valueSuffix: ' mb'
  106. }
  107. }, {
  108. name: 'Temperature',
  109. color: '#89A54E',
  110. type: 'spline',
  111. data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6],
  112. tooltip: {
  113. valueSuffix: ' °C'
  114. }
  115. }]
  116. });
  117. });
  118. </script>
  119. </head>
  120. <body>
  121. <script src="../../js/highcharts.js"></script>
  122. <script src="../../js/modules/exporting.js"></script>
  123. <div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
  124. </body>
  125. </html>