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.

93 lines
2.6 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: 'World\'s largest cities per 2014'
  18. },
  19. subtitle: {
  20. text: 'Source: <a href="http://en.wikipedia.org/wiki/List_of_cities_proper_by_population">Wikipedia</a>'
  21. },
  22. xAxis: {
  23. type: 'category',
  24. labels: {
  25. rotation: -45,
  26. style: {
  27. fontSize: '13px',
  28. fontFamily: 'Verdana, sans-serif'
  29. }
  30. }
  31. },
  32. yAxis: {
  33. min: 0,
  34. title: {
  35. text: 'Population (millions)'
  36. }
  37. },
  38. legend: {
  39. enabled: false
  40. },
  41. tooltip: {
  42. pointFormat: 'Population in 2008: <b>{point.y:.1f} millions</b>'
  43. },
  44. series: [{
  45. name: 'Population',
  46. data: [
  47. ['Shanghai', 23.7],
  48. ['Lagos', 16.1],
  49. ['Instanbul', 14.2],
  50. ['Karachi', 14.0],
  51. ['Mumbai', 12.5],
  52. ['Moscow', 12.1],
  53. ['São Paulo', 11.8],
  54. ['Beijing', 11.7],
  55. ['Guangzhou', 11.1],
  56. ['Delhi', 11.1],
  57. ['Shenzhen', 10.5],
  58. ['Seoul', 10.4],
  59. ['Jakarta', 10.0],
  60. ['Kinshasa', 9.3],
  61. ['Tianjin', 9.3],
  62. ['Tokyo', 9.0],
  63. ['Cairo', 8.9],
  64. ['Dhaka', 8.9],
  65. ['Mexico City', 8.9],
  66. ['Lima', 8.9]
  67. ],
  68. dataLabels: {
  69. enabled: true,
  70. rotation: -90,
  71. color: '#FFFFFF',
  72. align: 'right',
  73. format: '{point.y:.1f}', // one decimal
  74. y: 10, // 10 pixels down from the top
  75. style: {
  76. fontSize: '13px',
  77. fontFamily: 'Verdana, sans-serif'
  78. }
  79. }
  80. }]
  81. });
  82. });
  83. </script>
  84. </head>
  85. <body>
  86. <script src="../../js/highcharts.js"></script>
  87. <script src="../../js/modules/exporting.js"></script>
  88. <div id="container" style="min-width: 300px; height: 400px; margin: 0 auto"></div>
  89. </body>
  90. </html>