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
// create data set
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
{'id': 'AU.TS', 'size': 514700}
18
];
19
20
// create map chart
21
var map = anychart.map();
22
23
// set geodata using https://cdn.anychart.com/geodata/2.2.0/countries/australia/australia.js
24
map.geoData(anychart.maps.australia);
25
26
//set bubble min/max size settings
27
map.maxBubbleSize('10%');
28
map.minBubbleSize('3%');
29
30
//create bubble series
31
var series = map.bubble(data);
32
33
// set colors
34
series.normal().hatchFill("percent30");
35
series.hovered().hatchFill("percent20");
36
series.selected().hatchFill("percent50");
37
series.normal().fill("white");
38
series.hovered().fill("white");
39
series.selected().fill("white");
40
series.normal().stroke("black");
41
series.hovered().stroke("black", 2);
42
series.selected().stroke("black", 2);
43
44
// set container id for the chart
45
map.container('container');
46
// initiate chart drawing
47
map.draw();
48
});