Highcharts Demo
author(s): Wojciech Chmiel
by jpeter06
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/stock/modules/data.js"></script>
<script src="https://code.highcharts.com/mapdata/custom/europe.js"></script>
<script src="https://code.highcharts.com/modules/marker-clusters.js"></script>
<script src="https://code.highcharts.com/modules/coloraxis.js"></script>
<div id="container"></div>
CSS
#container {
min-width: 310px;
max-width: 1200px;
height: 600px;
margin: 0 auto;
}
JavaScript
Highcharts.SVGRenderer.prototype.symbols.cross = function (x, y, w, h) { console.log("callled");
return ['M', x, y, 'L', x + w, y + h, 'M', x + w, y, 'L', x, y + h, 'z'];
};
(function (H) {
H.wrap(H.Series.prototype, 'drawGraph', function (proceed) {
// Before the original function
console.log("We are about to draw the graph:", typeof this.graph);
// Now apply the original function with the original arguments,
// which are sliced off this function's arguments
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
// Add some code after the original function
console.log("We just finished drawing the graph:", typeof this.graph);
});
}(Highcharts));
Highcharts.getJSON('https://cdn.jsdelivr.net/gh/highcharts/highcharts@1e9e659c2d60fbe27ef0b41e2f93112dd68fb7a3/samples/data/european-train-stations-near-airports.json', function (data) {
Highcharts.mapChart('container', {
chart: {
map: 'custom/europe'
},
title: {
text: 'European Train Stations Near Airports'
},
subtitle: {
text: 'Data source: https://github.com/trainline-eu/stations'
},
mapNavigation: {
enabled: true
},
tooltip: {
formatter: function () {
if (this.point.clusteredData) {
return 'Clustered points: ' + this.point.clusterPointsAmount;
}
return '<b>' + this.key + '</b><br>Lat: ' + this.point.lat.toFixed(2) + ', Lon: ' + this.point.lon.toFixed(2);
}
},
colorAxis: {
min: 0,
max: 20
},
plotOptions: {
mappoint: {
cluster: {
marker: {
symbol: 'triangle'
},
enabled: true,
allowOverlap: false,
animation: {
duration: 450
...