-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
150 lines (121 loc) · 3.71 KB
/
index.html
File metadata and controls
150 lines (121 loc) · 3.71 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!-- Styles -->
<style>
#chartdiv {
width: 100%;
height: 800px;
}
</style>
<!-- Resources -->
<script src="https://cdn.amcharts.com/lib/5/index.js"></script>
<script src="https://cdn.amcharts.com/lib/5/map.js"></script>
<script src="https://cdn.amcharts.com/lib/5/geodata/worldLow.js"></script>
<script src="https://cdn.amcharts.com/lib/5/themes/Animated.js"></script>
<!-- Chart code -->
<script>
am5.ready(function() {
// Data
var groupData = [
{
"name": "Linux OX- Phenix Decodeur",
"data": [
{ "id": "FR", "STB":"Sagemcom - Samsung - more than 7 millions devices","model":"IHD92,UHD90,WHD93,WHD94,UHD90"}
]
}, {
"name": "Android OS- Cherry V1 decodeur",
"data": [
{ "id": "MD", "STB": "?" },
]
}, {
"name": "Mix - Android and Linux OS",
"data": [
{ "id": "BE", "STB": "Siligence - Commscope - Box Android : Cherry V1"},
{ "id": "ES", "STB": "Samsung - Kaonmedia - HUMAX...- more than 500 000 devices","model":"OHD80,CACTUS Stb,Suricata,WHD81,osp_vsb3918"},
{ "id": "PL", "STB": "Sagemcom - Samsung - more than 800 000 devices mainly Linux","model":"IWU200 (Toivo),IWU300,UHD86,UHD88,WHD80,ICU100 (Dakota),DV8555 (Destiny)"},
{ "id": "SK", "STB": " ? Box Android: Cherry V1 just starded" },
]
},{
"name": "Undetermined",
"data": [
{ "id": "RO", "STB": "?" },
]
}
];
// Create root and chart
var root = am5.Root.new("chartdiv");
// Set themes
root.setThemes([
am5themes_Animated.new(root)
]);
// Create chart
var chart = root.container.children.push(am5map.MapChart.new(root, {
homeZoomLevel: 3.5,
homeGeoPoint: { longitude: 10, latitude: 52 }
}));
// Create world polygon series
var worldSeries = chart.series.push(am5map.MapPolygonSeries.new(root, {
geoJSON: am5geodata_worldLow,
exclude: ["AQ"]
}));
worldSeries.mapPolygons.template.setAll({
fill: am5.color(0xaaaaaa)
});
worldSeries.events.on("datavalidated", () => {
chart.goHome();
});
// Add legend
var legend = chart.children.push(am5.Legend.new(root, {
useDefaultMarker: true,
centerX: am5.p50,
x: am5.p50,
centerY: am5.p100,
y: am5.p100,
dy: -20,
background: am5.RoundedRectangle.new(root, {
fill: am5.color(0xffffff),
fillOpacity: 0.2
})
}));
legend.valueLabels.template.set("forceHidden", true)
// Create series for each group
var colors = am5.ColorSet.new(root, {
step: 2
});
colors.next();
am5.array.each(groupData, function(group) {
var countries = [];
var color = colors.next();
am5.array.each(group.data, function(country) {
countries.push(country.id)
});
var polygonSeries = chart.series.push(am5map.MapPolygonSeries.new(root, {
geoJSON: am5geodata_worldLow,
include: countries,
name: group.name,
fill: color
}));
polygonSeries.mapPolygons.template.setAll({
tooltipText: "[bold]{name}[/]\nManufacturer:\t {STB}[/]\nModel:\t {model}",
interactive: true,
fill: color,
strokeWidth: 2
});
polygonSeries.mapPolygons.template.states.create("hover", {
fill: am5.Color.brighten(color, -0.3)
});
polygonSeries.mapPolygons.template.events.on("pointerover", function(ev) {
ev.target.series.mapPolygons.each(function(polygon) {
polygon.states.applyAnimate("hover");
});
});
polygonSeries.mapPolygons.template.events.on("pointerout", function(ev) {
ev.target.series.mapPolygons.each(function(polygon) {
polygon.states.applyAnimate("default");
});
});
polygonSeries.data.setAll(group.data);
legend.data.push(polygonSeries);
});
}); // end am5.ready()
</script>
<!-- HTML -->
<div id="chartdiv"></div>