You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.3 KiB

9 years ago
  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. <style type="text/css">
  8. ${demo.css}
  9. </style>
  10. <script type="text/javascript">
  11. $(function () {
  12. $('#container').highcharts({
  13. chart: {
  14. type: 'column'
  15. },
  16. title: {
  17. text: 'Monthly Average Rainfall'
  18. },
  19. subtitle: {
  20. text: 'Source: WorldClimate.com'
  21. },
  22. xAxis: {
  23. categories: [
  24. 'Jan',
  25. 'Feb',
  26. 'Mar',
  27. 'Apr',
  28. 'May',
  29. 'Jun',
  30. 'Jul',
  31. 'Aug',
  32. 'Sep',
  33. 'Oct',
  34. 'Nov',
  35. 'Dec'
  36. ],
  37. crosshair: true
  38. },
  39. yAxis: {
  40. min: 0,
  41. title: {
  42. text: 'Rainfall (mm)'
  43. }
  44. },
  45. tooltip: {
  46. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  47. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  48. '<td style="padding:0"><b>{point.y:.1f} mm</b></td></tr>',
  49. footerFormat: '</table>',
  50. shared: true,
  51. useHTML: true
  52. },
  53. plotOptions: {
  54. column: {
  55. pointPadding: 0.2,
  56. borderWidth: 0
  57. }
  58. },
  59. series: [{
  60. name: 'Tokyo',
  61. 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]
  62. }, {
  63. name: 'New York',
  64. data: [83.6, 78.8, 98.5, 93.4, 106.0, 84.5, 105.0, 104.3, 91.2, 83.5, 106.6, 92.3]
  65. }, {
  66. name: 'London',
  67. data: [48.9, 38.8, 39.3, 41.4, 47.0, 48.3, 59.0, 59.6, 52.4, 65.2, 59.3, 51.2]
  68. }, {
  69. name: 'Berlin',
  70. data: [42.4, 33.2, 34.5, 39.7, 52.6, 75.5, 57.4, 60.4, 47.6, 39.1, 46.8, 51.1]
  71. }]
  72. });
  73. });
  74. </script>
  75. </head>
  76. <body>
  77. <script src="../../js/highcharts.js"></script>
  78. <script src="../../js/modules/exporting.js"></script>
  79. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  80. </body>
  81. </html>