index.htm 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. // Prepare random data
  23. var data = [
  24. {
  25. "code": "DE.SH",
  26. "value": 728
  27. },
  28. {
  29. "code": "DE.BE",
  30. "value": 710
  31. },
  32. {
  33. "code": "DE.MV",
  34. "value": 963
  35. },
  36. {
  37. "code": "DE.HB",
  38. "value": 541
  39. },
  40. {
  41. "code": "DE.HH",
  42. "value": 622
  43. },
  44. {
  45. "code": "DE.RP",
  46. "value": 866
  47. },
  48. {
  49. "code": "DE.SL",
  50. "value": 398
  51. },
  52. {
  53. "code": "DE.BY",
  54. "value": 785
  55. },
  56. {
  57. "code": "DE.SN",
  58. "value": 223
  59. },
  60. {
  61. "code": "DE.ST",
  62. "value": 605
  63. },
  64. {
  65. "code": "DE.",
  66. "value": 361
  67. },
  68. {
  69. "code": "DE.NW",
  70. "value": 237
  71. },
  72. {
  73. "code": "DE.BW",
  74. "value": 157
  75. },
  76. {
  77. "code": "DE.HE",
  78. "value": 134
  79. },
  80. {
  81. "code": "DE.NI",
  82. "value": 136
  83. },
  84. {
  85. "code": "DE.TH",
  86. "value": 704
  87. }
  88. ];
  89. $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=germany.geo.json&callback=?', function (geojson) {
  90. // Initiate the chart
  91. $('#container').highcharts('Map', {
  92. title : {
  93. text : 'GeoJSON in Highmaps'
  94. },
  95. mapNavigation: {
  96. enabled: true,
  97. buttonOptions: {
  98. verticalAlign: 'bottom'
  99. }
  100. },
  101. colorAxis: {
  102. },
  103. series : [{
  104. data : data,
  105. mapData: geojson,
  106. joinBy: ['code_hasc', 'code'],
  107. name: 'Random data',
  108. states: {
  109. hover: {
  110. color: '#BADA55'
  111. }
  112. },
  113. dataLabels: {
  114. enabled: true,
  115. format: '{point.properties.postal}'
  116. }
  117. }]
  118. });
  119. });
  120. });
  121. </script>
  122. </head>
  123. <body>
  124. <script src="../../js/highmaps.js"></script>
  125. <script src="../../js/modules/data.js"></script>
  126. <script src="../../js/modules/exporting.js"></script>
  127. <div id="container" style="min-width: 310px; max-width: 400px"></div>
  128. </body>
  129. </html>