市长热线演示版

index.htm 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. <script type="text/javascript">
  8. var chart;
  9. $(function() {
  10. $('#container').highcharts({
  11. chart: {
  12. zoomType: 'xy'
  13. },
  14. title: {
  15. text: 'Temperature vs Rainfall'
  16. },
  17. xAxis: [{
  18. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  19. }],
  20. yAxis: [{ // Primary yAxis
  21. labels: {
  22. format: '{value} °C',
  23. style: {
  24. color: Highcharts.getOptions().colors[1]
  25. }
  26. },
  27. title: {
  28. text: 'Temperature',
  29. style: {
  30. color: Highcharts.getOptions().colors[1]
  31. }
  32. }
  33. }, { // Secondary yAxis
  34. title: {
  35. text: 'Rainfall',
  36. style: {
  37. color: Highcharts.getOptions().colors[0]
  38. }
  39. },
  40. labels: {
  41. format: '{value} mm',
  42. style: {
  43. color: Highcharts.getOptions().colors[0]
  44. }
  45. },
  46. opposite: true
  47. }],
  48. tooltip: {
  49. shared: true
  50. },
  51. series: [{
  52. name: 'Rainfall',
  53. type: 'column',
  54. yAxis: 1,
  55. 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],
  56. tooltip: {
  57. pointFormat: '<span style="font-weight: bold; color: {series.color}">{series.name}</span>: <b>{point.y:.1f} mm</b> '
  58. }
  59. }, {
  60. name: 'Rainfall error',
  61. type: 'errorbar',
  62. yAxis: 1,
  63. data: [[48, 51], [68, 73], [92, 110], [128, 136], [140, 150], [171, 179], [135, 143], [142, 149], [204, 220], [189, 199], [95, 110], [52, 56]],
  64. tooltip: {
  65. pointFormat: '(error range: {point.low}-{point.high} mm)<br/>'
  66. }
  67. }, {
  68. name: 'Temperature',
  69. type: 'spline',
  70. 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],
  71. tooltip: {
  72. pointFormat: '<span style="font-weight: bold; color: {series.color}">{series.name}</span>: <b>{point.y:.1f}°C</b> '
  73. }
  74. }, {
  75. name: 'Temperature error',
  76. type: 'errorbar',
  77. data: [[6, 8], [5.9, 7.6], [9.4, 10.4], [14.1, 15.9], [18.0, 20.1], [21.0, 24.0], [23.2, 25.3], [26.1, 27.8], [23.2, 23.9], [18.0, 21.1], [12.9, 14.0], [7.6, 10.0]],
  78. tooltip: {
  79. pointFormat: '(error range: {point.low}-{point.high}°C)<br/>'
  80. }
  81. }]
  82. });
  83. });
  84. </script>
  85. </head>
  86. <body>
  87. <script src="../../js/highcharts.js"></script>
  88. <script src="../../js/highcharts-more.js"></script>
  89. <script src="../../js/modules/exporting.js"></script>
  90. <div id="container" style="height: 400px; margin: auto; min-width: 310px; max-width: 600px"></div>
  91. </body>
  92. </html>