Highcharts Demo
author(s):
Torstein Hønsi
HTML
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/maps/highmaps.js"></script>
<script src="https://code.highcharts.com/maps/modules/data.js"></script>
<script src="https://code.highcharts.com/mapdata/custom/europe.js"></script>
<div id="container" style="height: 500px; min-width: 310px; max-width: 480px; margin: 0 auto"></div>
JavaScript
// Instanciate the map
Highcharts.mapChart('container', {
chart: {
spacingBottom: 20
},
title: {
text: 'La législation des pays européens concernant la chasse à courre'
},
legend: {
enabled: true
},
plotOptions: {
map: {
allAreas: false,
joinBy: ['iso-a2', 'code'],
dataLabels: {
enabled: true,
color: '#FFFFFF',
formatter: function () {
if (this.point.properties && this.point.properties.labelrank.toString() < 5) {
return this.point.properties['iso-a2'];
}
},
format: null,
style: {
fontWeight: 'bold'
}
},
mapData: Highcharts.maps['custom/europe'],
tooltip: {
headerFormat: '',
pointFormat: '{point.name}: <b>{series.name}</b>'
}
}
},
series: [{
name: 'La vénerie est interdite',
color: '#FE2E2E',
data: $.map(['IE', 'GB', 'DE', 'BE', 'LU', 'CH', 'NL'], function (code) {
return { code: code }
})
}, {
name: 'La vénerie est pratiquée',
color: '#81F781',
data: $.map(['DK', 'PT', 'ES', 'FR', 'IT'], function (code) {
return { code: code };
})
}]
});