index.htm 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>Highcharts Example</title>
  7. <style type="text/css">
  8. </style>
  9. </head>
  10. <body>
  11. <script src="../../code/highcharts.js"></script>
  12. <script src="../../code/modules/exporting.js"></script>
  13. <script src="../../code/modules/export-data.js"></script>
  14. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  15. <script type="text/javascript">
  16. Highcharts.chart('container', {
  17. chart: {
  18. zoomType: 'xy'
  19. },
  20. title: {
  21. text: 'Average Monthly Temperature and Rainfall in Tokyo'
  22. },
  23. subtitle: {
  24. text: 'Source: WorldClimate.com'
  25. },
  26. xAxis: [{
  27. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  28. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
  29. crosshair: true
  30. }],
  31. yAxis: [{ // Primary yAxis
  32. labels: {
  33. format: '{value}°C',
  34. style: {
  35. color: Highcharts.getOptions().colors[1]
  36. }
  37. },
  38. title: {
  39. text: 'Temperature',
  40. style: {
  41. color: Highcharts.getOptions().colors[1]
  42. }
  43. }
  44. }, { // Secondary yAxis
  45. title: {
  46. text: 'Rainfall',
  47. style: {
  48. color: Highcharts.getOptions().colors[0]
  49. }
  50. },
  51. labels: {
  52. format: '{value} mm',
  53. style: {
  54. color: Highcharts.getOptions().colors[0]
  55. }
  56. },
  57. opposite: true
  58. }],
  59. tooltip: {
  60. shared: true
  61. },
  62. legend: {
  63. layout: 'vertical',
  64. align: 'left',
  65. x: 120,
  66. verticalAlign: 'top',
  67. y: 100,
  68. floating: true,
  69. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || 'rgba(255,255,255,0.25)'
  70. },
  71. series: [{
  72. name: 'Rainfall',
  73. type: 'column',
  74. yAxis: 1,
  75. 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],
  76. tooltip: {
  77. valueSuffix: ' mm'
  78. }
  79. }, {
  80. name: 'Temperature',
  81. type: 'spline',
  82. 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],
  83. tooltip: {
  84. valueSuffix: '°C'
  85. }
  86. }]
  87. });
  88. </script>
  89. </body>
  90. </html>