index.htm 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 Temperature and Rainfall in 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. format: '{value}°C',
  26. style: {
  27. color: '#89A54E'
  28. }
  29. },
  30. title: {
  31. text: 'Temperature',
  32. style: {
  33. color: '#89A54E'
  34. }
  35. }
  36. }, { // Secondary yAxis
  37. title: {
  38. text: 'Rainfall',
  39. style: {
  40. color: '#4572A7'
  41. }
  42. },
  43. labels: {
  44. format: '{value} mm',
  45. style: {
  46. color: '#4572A7'
  47. }
  48. },
  49. opposite: true
  50. }],
  51. tooltip: {
  52. shared: true
  53. },
  54. legend: {
  55. layout: 'vertical',
  56. align: 'left',
  57. x: 120,
  58. verticalAlign: 'top',
  59. y: 100,
  60. floating: true,
  61. backgroundColor: '#FFFFFF'
  62. },
  63. series: [{
  64. name: 'Rainfall',
  65. color: '#4572A7',
  66. type: 'column',
  67. yAxis: 1,
  68. 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],
  69. tooltip: {
  70. valueSuffix: ' mm'
  71. }
  72. }, {
  73. name: 'Temperature',
  74. color: '#89A54E',
  75. type: 'spline',
  76. 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],
  77. tooltip: {
  78. valueSuffix: '°C'
  79. }
  80. }]
  81. });
  82. });
  83. </script>
  84. </head>
  85. <body>
  86. <script src="../../js/highcharts.js"></script>
  87. <script src="../../js/modules/exporting.js"></script>
  88. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  89. </body>
  90. </html>