forked from bjornd/jvectormap
-
Notifications
You must be signed in to change notification settings - Fork 14
/
demo.html
39 lines (37 loc) · 1021 Bytes
/
demo.html
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
<!DOCTYPE html>
<html>
<head>
<title>jVectorMap DEMO</title>
<link rel="stylesheet" href="jvectormap-next/jquery-jvectormap.css" />
</head>
<body>
<div id="root" style="height: 500px"></div>
<script src="jvectormap-next/tests/assets/jquery-1.8.2.js"></script>
<script src="jvectormap-next/jquery-jvectormap.min.js"></script>
<script src="jvectormap-content/world-mill.js"></script>
<script>
// render the map
var gdpData = {
AF: 16.63,
AL: 11.58,
DZ: 158.97,
// ...
};
$('#root').vectorMap({
map: 'world_mill',
series: {
regions: [
{
values: gdpData,
scale: ['#C8EEFF', '#0071A4'],
normalizeFunction: 'polynomial',
},
],
},
onRegionTipShow: function(e, el, code) {
gdpData[code] ? el.html(el.html() + ' (GDP - ' + gdpData[code] + ')') : el.html();
},
});
</script>
</body>
</html>