Tile map, circles
author(s):
Mustapha Mekhatria
by sridhar reddy
HTML
<script src="https://code.highcharts.com/maps/highmaps.js"></script>
<script src="https://code.highcharts.com/modules/tilemap.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/offline-exporting.js"></script>
<div id="container"></div>
CSS
#container {
min-width: 320px;
max-width: 550px;
margin: 0 auto
}
JavaScript
Highcharts.chart('container', {
chart: {
type: 'tilemap',
height: '125%'
},
title: {
text: 'Africa Real GDP Growth Forcasts for 2017'
},
xAxis: {
visible: false
},
yAxis: {
visible: false
},
legend: {
enabled: true,
layout: 'vertical',
align: 'left',
y: -20,
floating: true
},
colorAxis: {
dataClasses: [{
to: 2,
color: '#e8f5e9',
name: 'Weak'
}, {
from: 2,
to: 5,
color: '#81c784',
name: 'Average'
}, {
from: 5,
to: 6,
color: '#43a047',
name: 'Strong'
}, {
from: 6,
color: '#1b5e20',
name: 'Stellar'
}]
},
tooltip: {
headerFormat: '',
pointFormat: 'The real GDP growth of <b>{point.name}</b> is <b>{point.value}</b> %'
},
plotOptions: {
series: {
tileShape: 'circle',
tile
dataLabels: {
enabled: true,
format: '{point.iso-a3}',
color: '#000000',
style: {
textOutline: false
}
}
}
},
series: [{
data: [{
id: 'ZW',
name: 'Zimbabwe',
subregion: 'Eastern Africa',
'region-web': 'Sub-Saharan Africa',
'iso-a3': 'ZWE',
'iso-a2': 'ZW',
x: 12,
y: 1,
value: 1.7
}, {
id: 'ZM',
name: 'Zambia',
subregion: 'Eastern Africa',
'region-web': 'Sub-Saharan Africa',
'iso-a3': 'ZMB',
'iso-a2': 'ZM',
x: 11,
y: 2,
value: 3.2
}, {
id: 'MG',
name: 'Madagascar',
subregion: 'Eastern Africa',
...