HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
3
// This sample uses 3rd party proj4 component
4
// that makes it possible to set coordinates
5
// for the points and labels on the map and
6
// required for custom projections and grid labels formatting.
7
// See https://docs.anychart.com/Maps/Map_Projections
8
9
// data
10
var data = [
11
{'id': 'AU.NS', 'size': 7565500},
12
{'id': 'AU.NT', 'size': 243700},
13
{'id': 'AU.WA', 'size': 2565600},
14
{'id': 'AU.SA', 'size': 1682600},
15
{'id': 'AU.VI', 'size': 5866300},
16
{'id': 'AU.QL', 'size': 4750500,
17
normal: {
18
fill: "#b30059 0.3",
19
stroke: "#b30059"
20
},
21
hovered: {
22
fill: "#b30059 0.1",
23
stroke: "2 #b30059"
24
},
25
selected: {
26
fill: "#b30059 0.5",
27
stroke: "4 #b30059"
28
}
29
},
30
{'id': 'AU.TS', 'size': 514700}
31
];
32
33
// create map chart
34
var map = anychart.map();
35
36
// set geodata using https://cdn.anychart.com/geodata/2.2.0/countries/australia/australia.js
37
map.geoData(anychart.maps.australia);
38
39
//create bubble series
40
var series = map.bubble(data);
41
42
// set container id for the chart
43
map.container('container');
44
45
// initiate chart drawing
46
map.draw();
47
});