Highcharts Demo
author(s):
Øystein Moseng
Torstein Hønsi
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js"></script>
<script src="https://code.highcharts.com/maps/highmaps.js"></script>
<script src="https://code.highcharts.com/maps/modules/exporting.js"></script>
<script src="https://code.highcharts.com/mapdata/countries/de/de-all.js"></script>
<div id="container"></div>
CSS
#container {
height: 680px;
min-width: 310px;
max-width: 800px;
margin: 0 auto;
}
.loading {
margin-top: 10em;
text-align: center;
color: gray;
}
JavaScript
$(function () {
// Initiate the chart
Highcharts.mapChart('container', {
title: {
text: 'Hover over location to see datastore response times'
},
mapNavigation: {
enabled: true
},
tooltip: {
headerFormat: '',
pointFormat: '<b>{point.name}</b><br> response time {point.response_time} sec'
},
series: [{
// Use the gb-all map with no data as a basemap
mapData: Highcharts.maps['countries/de/de-all'],
name: 'Basemap',
borderColor: '#A0A0A0',
nullColor: 'rgba(200, 200, 200, 0.3)',
showInLegend: false
}, {
name: 'Separators',
type: 'mapline',
data: Highcharts.geojson(Highcharts.maps['countries/gb/gb-all'], 'mapline'),
color: '#707070',
showInLegend: false,
enableMouseTracking: false
}, {
// Specify points using lat/lon
type: 'mappoint',
name: 'Datastore locations',
color: Highcharts.getOptions().colors[1],
data: [{
name: 'London',
lat: 51.507222,
lon: -0.1275,
response_time:1.0
},{
name: 'Glasgow',
lat: 55.858,
lon: -4.259,
response_time:0.9
}, {
name: 'Belfast',
lat: 54.597,
lon: -5.93,
response_time:1.2
}]
}]
});
});