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.

69 lines
1.9 KiB

8 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. title: {
  14. text: 'Monthly Average Temperature',
  15. x: -20 //center
  16. },
  17. subtitle: {
  18. text: 'Source: WorldClimate.com',
  19. x: -20
  20. },
  21. xAxis: {
  22. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  23. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  24. },
  25. yAxis: {
  26. title: {
  27. text: 'Temperature (°C)'
  28. },
  29. plotLines: [{
  30. value: 0,
  31. width: 1,
  32. color: '#808080'
  33. }]
  34. },
  35. tooltip: {
  36. valueSuffix: '°C'
  37. },
  38. legend: {
  39. layout: 'vertical',
  40. align: 'right',
  41. verticalAlign: 'middle',
  42. borderWidth: 0
  43. },
  44. series: [{
  45. name: 'Tokyo',
  46. 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]
  47. }, {
  48. name: 'New York',
  49. data: [-0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5]
  50. }, {
  51. name: 'Berlin',
  52. data: [-0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0]
  53. }, {
  54. name: 'London',
  55. data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]
  56. }]
  57. });
  58. });
  59. </script>
  60. </head>
  61. <body>
  62. <script src="../../js/highcharts.js"></script>
  63. <script src="../../js/modules/exporting.js"></script>
  64. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  65. </body>
  66. </html>