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.

89 lines
2.0 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. chart: {
  14. type: 'columnrange',
  15. inverted: true
  16. },
  17. title: {
  18. text: 'Temperature variation by month'
  19. },
  20. subtitle: {
  21. text: 'Observed in Vik i Sogn, Norway'
  22. },
  23. xAxis: {
  24. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  25. },
  26. yAxis: {
  27. title: {
  28. text: 'Temperature ( °C )'
  29. }
  30. },
  31. tooltip: {
  32. valueSuffix: '°C'
  33. },
  34. plotOptions: {
  35. columnrange: {
  36. dataLabels: {
  37. enabled: true,
  38. formatter: function () {
  39. return this.y + '°C';
  40. }
  41. }
  42. }
  43. },
  44. legend: {
  45. enabled: false
  46. },
  47. series: [{
  48. name: 'Temperatures',
  49. data: [
  50. [-9.7, 9.4],
  51. [-8.7, 6.5],
  52. [-3.5, 9.4],
  53. [-1.4, 19.9],
  54. [0.0, 22.6],
  55. [2.9, 29.5],
  56. [9.2, 30.7],
  57. [7.3, 26.5],
  58. [4.4, 18.0],
  59. [-3.1, 11.4],
  60. [-5.2, 10.4],
  61. [-13.5, 9.8]
  62. ]
  63. }]
  64. });
  65. });
  66. </script>
  67. </head>
  68. <body>
  69. <script src="../../js/highcharts.js"></script>
  70. <script src="../../js/highcharts-more.js"></script>
  71. <script src="../../js/modules/exporting.js"></script>
  72. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  73. </body>
  74. </html>