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.

77 lines
2.1 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: 'area'
  15. },
  16. title: {
  17. text: 'Historic and Estimated Worldwide Population Distribution by Region'
  18. },
  19. subtitle: {
  20. text: 'Source: Wikipedia.org'
  21. },
  22. xAxis: {
  23. categories: ['1750', '1800', '1850', '1900', '1950', '1999', '2050'],
  24. tickmarkPlacement: 'on',
  25. title: {
  26. enabled: false
  27. }
  28. },
  29. yAxis: {
  30. title: {
  31. text: 'Percent'
  32. }
  33. },
  34. tooltip: {
  35. pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.percentage:.1f}%</b> ({point.y:,.0f} millions)<br/>',
  36. shared: true
  37. },
  38. plotOptions: {
  39. area: {
  40. stacking: 'percent',
  41. lineColor: '#ffffff',
  42. lineWidth: 1,
  43. marker: {
  44. lineWidth: 1,
  45. lineColor: '#ffffff'
  46. }
  47. }
  48. },
  49. series: [{
  50. name: 'Asia',
  51. data: [502, 635, 809, 947, 1402, 3634, 5268]
  52. }, {
  53. name: 'Africa',
  54. data: [106, 107, 111, 133, 221, 767, 1766]
  55. }, {
  56. name: 'Europe',
  57. data: [163, 203, 276, 408, 547, 729, 628]
  58. }, {
  59. name: 'America',
  60. data: [18, 31, 54, 156, 339, 818, 1201]
  61. }, {
  62. name: 'Oceania',
  63. data: [2, 2, 2, 6, 13, 30, 46]
  64. }]
  65. });
  66. });
  67. </script>
  68. </head>
  69. <body>
  70. <script src="../../js/highcharts.js"></script>
  71. <script src="../../js/modules/exporting.js"></script>
  72. <div id="container" style="min-width: 310px; height: 400px; max-width: 800px; margin: 0 auto"></div>
  73. </body>
  74. </html>