-
Notifications
You must be signed in to change notification settings - Fork 1
/
maps.js
98 lines (88 loc) · 2.48 KB
/
maps.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
$(document).ready(function(){
var test = Highcharts.maps.nicaragua;
$.each(test, function(i){
this.drilldown = this.key;
this.value = i;
});
console.log(test);
Highcharts.mapChart('nicaragua', {
chart: {
events: {
drilldown: function(e){
if (!e.seriesOptions){
var chart = this;
mapkey = 'maps/' + e.point.drilldown;
$.get(mapkey + '.json', function(data) {
$.each(data, function (i) {
this.value = i;
});
chart.addSeriesAsDrilldown(e.point, {
name: e.point.name,
data: data.data,
dataLabels: {
enabled: true,
format: '{point.name}'
}
});
console.log(data);
});
}
}
}
},
title: {
text: 'Mapa de Nicaragua'
},
subtitle: {
text: 'NIC',
floating: true,
align: 'right',
y: 50,
style: {
fontSize: '16px'
}
},
colorAxis: {
min: 0,
minColor: '#99DAFF',
maxColor: '#569CC4'
},
mapNavigation: {
enabled: true,
buttonOptions: {
verticalAlign: 'bottom'
}
},
plotOptions: {
map: {
states: {
hover: {
color: '#EEDD66'
}
}
}
},
series: [{
data: test,
name: 'NIC',
dataLabels: {
enabled: true,
format: '{point.name}'
}
}],
drilldown: {
activeDataLabelStyle: {
color: '#FFFFFF',
textDecoration: 'none',
textOutline: '1px #000000'
},
drillUpButton: {
relativeTo: 'spacingBox',
position: {
x: 0,
y: 60
}
}
}
});
});