c3cf2b11a642dd1c87966a34441cb7159ff348ff.svn-base 2.7 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://cdn.hcharts.cn/jquery/jquery-1.8.3.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. zoomType: 'xy'
  15. },
  16. title: {
  17. text: 'Average Monthly Temperature and Rainfall in Tokyo'
  18. },
  19. subtitle: {
  20. text: 'Source: WorldClimate.com'
  21. },
  22. xAxis: [{
  23. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  24. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
  25. crosshair: true
  26. }],
  27. yAxis: [{ // Primary yAxis
  28. labels: {
  29. format: '{value}°C',
  30. style: {
  31. color: Highcharts.getOptions().colors[1]
  32. }
  33. },
  34. title: {
  35. text: 'Temperature',
  36. style: {
  37. color: Highcharts.getOptions().colors[1]
  38. }
  39. }
  40. }, { // Secondary yAxis
  41. title: {
  42. text: 'Rainfall',
  43. style: {
  44. color: Highcharts.getOptions().colors[0]
  45. }
  46. },
  47. labels: {
  48. format: '{value} mm',
  49. style: {
  50. color: Highcharts.getOptions().colors[0]
  51. }
  52. },
  53. opposite: true
  54. }],
  55. tooltip: {
  56. shared: true
  57. },
  58. legend: {
  59. layout: 'vertical',
  60. align: 'left',
  61. x: 120,
  62. verticalAlign: 'top',
  63. y: 100,
  64. floating: true,
  65. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
  66. },
  67. series: [{
  68. name: 'Rainfall',
  69. type: 'column',
  70. yAxis: 1,
  71. 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],
  72. tooltip: {
  73. valueSuffix: ' mm'
  74. }
  75. }, {
  76. name: 'Temperature',
  77. type: 'spline',
  78. 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],
  79. tooltip: {
  80. valueSuffix: '°C'
  81. }
  82. }]
  83. });
  84. });
  85. </script>
  86. </head>
  87. <body>
  88. <script src="http://cdn.hcharts.cn/highcharts/highcharts.js"></script>
  89. <script src="http://cdn.hcharts.cn/highcharts/modules/exporting.js"></script>
  90. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  91. </body>
  92. </html>