index.htm 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. ${demo.css}
  9. </style>
  10. <script type="text/javascript">
  11. $(function () {
  12. $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=world-population.json&callback=?', function (data) {
  13. var mapData = Highcharts.geojson(Highcharts.maps['custom/world']);
  14. // Correct UK to GB in data
  15. $.each(data, function () {
  16. if (this.code === 'UK') {
  17. this.code = 'GB';
  18. }
  19. });
  20. $('#container').highcharts('Map', {
  21. chart : {
  22. borderWidth : 1
  23. },
  24. title: {
  25. text: 'World population 2013 by country'
  26. },
  27. subtitle : {
  28. text : 'Demo of Highcharts map with bubbles'
  29. },
  30. legend: {
  31. enabled: false
  32. },
  33. mapNavigation: {
  34. enabled: true,
  35. buttonOptions: {
  36. verticalAlign: 'bottom'
  37. }
  38. },
  39. series : [{
  40. name: 'Countries',
  41. mapData: mapData,
  42. color: '#E0E0E0',
  43. enableMouseTracking: false
  44. }, {
  45. type: 'mapbubble',
  46. mapData: mapData,
  47. name: 'Population 2013',
  48. joinBy: ['iso-a2', 'code'],
  49. data: data,
  50. minSize: 4,
  51. maxSize: '12%',
  52. tooltip: {
  53. pointFormat: '{point.code}: {point.z} thousands'
  54. }
  55. }]
  56. });
  57. });
  58. });
  59. </script>
  60. </head>
  61. <body>
  62. <script src="../../js/highmaps.js"></script>
  63. <script src="../../js/modules/data.js"></script>
  64. <script src="http://code.highcharts.com/mapdata/custom/world.js"></script>
  65. <div id="container" style="height: 500px; min-width: 310px; max-width: 800px; margin: 0 auto"></div>
  66. </body>
  67. </html>