index.htm 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 : 'Zoom in on country by double click'
  27. },
  28. mapNavigation: {
  29. enabled: true,
  30. enableDoubleClickZoomTo: true
  31. },
  32. colorAxis: {
  33. min: 1,
  34. max: 1000,
  35. type: 'logarithmic'
  36. },
  37. series : [{
  38. data : data,
  39. mapData: Highcharts.maps['custom/world'],
  40. joinBy: ['iso-a2', 'code'],
  41. name: 'Population density',
  42. states: {
  43. hover: {
  44. color: '#BADA55'
  45. }
  46. },
  47. tooltip: {
  48. valueSuffix: '/km²'
  49. }
  50. }]
  51. });
  52. });
  53. });
  54. </script>
  55. </head>
  56. <body>
  57. <script src="../../js/highmaps.js"></script>
  58. <script src="../../js/modules/data.js"></script>
  59. <script src="../../js/modules/exporting.js"></script>
  60. <script src="http://code.highcharts.com/mapdata/custom/world.js"></script>
  61. <div id="container" style="max-width: 1000px"></div>
  62. </body>
  63. </html>