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
// create data set
4
var dataSet = anychart.data.set([
5
{'id': 'AU.NS', 'size': 7565500},
6
{'id': 'AU.NT', 'size': 243700},
7
{'id': 'AU.WA', 'size': 2565600},
8
{'id': 'AU.SA', 'size': 1682600},
9
{'id': 'AU.VI', 'size': 5866300},
10
{'id': 'AU.QL', 'size': 4750500},
11
{'id': 'AU.TS', 'size': 514700}
12
]);
13
14
// create map chart
15
var map = anychart.map();
16
17
// set geodata using https://cdn.anychart.com/geodata/1.0.0/countries/australia/australia.js
18
map.geoData(anychart.maps.australia);
19
20
//set bubble min/max size settings
21
map.maxBubbleSize('10%');
22
map.minBubbleSize('3%');
23
24
//create bubble series
25
var series = map.bubble(dataSet);
26
series.labels(true);
27
series.labels().fontColor('black');
28
29
//set series geo id field settings
30
series.geoIdField("code_hasc");
31
32
// set container id for the chart
33
map.container('container');
34
35
// initiate chart drawing
36
map.draw();
37
38
});