index.htm 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>Highmaps 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. #container {
  9. height: 500px;
  10. min-width: 310px;
  11. max-width: 800px;
  12. margin: 0 auto;
  13. }
  14. .loading {
  15. margin-top: 10em;
  16. text-align: center;
  17. color: gray;
  18. }
  19. </style>
  20. <script type="text/javascript">
  21. $(function () {
  22. $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=world-population-density.json&callback=?', function (data) {
  23. // Initiate the chart
  24. $('#container').highcharts('Map', {
  25. title : {
  26. text : 'Population density by country (/km²)'
  27. },
  28. mapNavigation: {
  29. enabled: true,
  30. buttonOptions: {
  31. verticalAlign: 'bottom'
  32. }
  33. },
  34. colorAxis: {
  35. min: 1,
  36. max: 1000,
  37. type: 'logarithmic'
  38. },
  39. series : [{
  40. data : data,
  41. mapData: Highcharts.maps['custom/world'],
  42. joinBy: ['iso-a2', 'code'],
  43. name: 'Population density',
  44. states: {
  45. hover: {
  46. color: '#BADA55'
  47. }
  48. },
  49. tooltip: {
  50. valueSuffix: '/km²'
  51. }
  52. }]
  53. });
  54. });
  55. });
  56. </script>
  57. </head>
  58. <body>
  59. <script src="../../js/highmaps.js"></script>
  60. <script src="../../js/modules/data.js"></script>
  61. <script src="../../js/modules/exporting.js"></script>
  62. <script src="http://code.highcharts.com/mapdata/custom/world.js"></script>
  63. <div id="container" style="max-width: 1000px"></div>
  64. </body>
  65. </html>