123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Highmaps Example</title>
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
- <style type="text/css">
- #container {
- height: 500px;
- min-width: 310px;
- max-width: 800px;
- margin: 0 auto;
- }
- .loading {
- margin-top: 10em;
- text-align: center;
- color: gray;
- }
- </style>
- <script type="text/javascript">
- $(function () {
- // Prepare random data
- var data = [
- {
- "code": "DE.SH",
- "value": 728
- },
- {
- "code": "DE.BE",
- "value": 710
- },
- {
- "code": "DE.MV",
- "value": 963
- },
- {
- "code": "DE.HB",
- "value": 541
- },
- {
- "code": "DE.HH",
- "value": 622
- },
- {
- "code": "DE.RP",
- "value": 866
- },
- {
- "code": "DE.SL",
- "value": 398
- },
- {
- "code": "DE.BY",
- "value": 785
- },
- {
- "code": "DE.SN",
- "value": 223
- },
- {
- "code": "DE.ST",
- "value": 605
- },
- {
- "code": "DE.",
- "value": 361
- },
- {
- "code": "DE.NW",
- "value": 237
- },
- {
- "code": "DE.BW",
- "value": 157
- },
- {
- "code": "DE.HE",
- "value": 134
- },
- {
- "code": "DE.NI",
- "value": 136
- },
- {
- "code": "DE.TH",
- "value": 704
- }
- ];
- $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=germany.geo.json&callback=?', function (geojson) {
- // Initiate the chart
- $('#container').highcharts('Map', {
- title : {
- text : 'GeoJSON in Highmaps'
- },
- mapNavigation: {
- enabled: true,
- buttonOptions: {
- verticalAlign: 'bottom'
- }
- },
- colorAxis: {
- },
- series : [{
- data : data,
- mapData: geojson,
- joinBy: ['code_hasc', 'code'],
- name: 'Random data',
- states: {
- hover: {
- color: '#BADA55'
- }
- },
- dataLabels: {
- enabled: true,
- format: '{point.properties.postal}'
- }
- }]
- });
- });
- });
- </script>
- </head>
- <body>
- <script src="../../js/highmaps.js"></script>
- <script src="../../js/modules/data.js"></script>
- <script src="../../js/modules/exporting.js"></script>
- <div id="container" style="min-width: 310px; max-width: 400px"></div>
- </body>
- </html>
|