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.

84 lines
2.2 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: 'bar'
  15. },
  16. title: {
  17. text: 'Historic World Population by Region'
  18. },
  19. subtitle: {
  20. text: 'Source: <a href="https://en.wikipedia.org/wiki/World_population">Wikipedia.org</a>'
  21. },
  22. xAxis: {
  23. categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania'],
  24. title: {
  25. text: null
  26. }
  27. },
  28. yAxis: {
  29. min: 0,
  30. title: {
  31. text: 'Population (millions)',
  32. align: 'high'
  33. },
  34. labels: {
  35. overflow: 'justify'
  36. }
  37. },
  38. tooltip: {
  39. valueSuffix: ' millions'
  40. },
  41. plotOptions: {
  42. bar: {
  43. dataLabels: {
  44. enabled: true
  45. }
  46. }
  47. },
  48. legend: {
  49. layout: 'vertical',
  50. align: 'right',
  51. verticalAlign: 'top',
  52. x: -40,
  53. y: 80,
  54. floating: true,
  55. borderWidth: 1,
  56. backgroundColor: ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'),
  57. shadow: true
  58. },
  59. credits: {
  60. enabled: false
  61. },
  62. series: [{
  63. name: 'Year 1800',
  64. data: [107, 31, 635, 203, 2]
  65. }, {
  66. name: 'Year 1900',
  67. data: [133, 156, 947, 408, 6]
  68. }, {
  69. name: 'Year 2012',
  70. data: [1052, 954, 4250, 740, 38]
  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; max-width: 800px; height: 400px; margin: 0 auto"></div>
  80. </body>
  81. </html>