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': 'Sydney', 'size': 106, "lat": -33.51, "lon": 151.11},
12
{'id': 'Cape York', 'size': 93, "lat": -10.41, "lon": 142.22},
13
{'id': 'Cape South-Point', 'size': 109, "lat": -39.08, "lon": 142.22},
14
{'id': 'Cape Byron', 'size': 108, "lat": -28.36, "lon": 153.38},
15
{'id': 'Steep-Point Cape', 'size': 95, "lat": -26.09, "lon": 113.09},
16
{"id": 'Alice Springs', 'size': 100, "lat": -23.69, "long": 133.87},
17
{"id": 'Adelaide', 'size': 99, "lat": -34.98, "long": 138.42}
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
//create bubble series
27
var series = map.bubble(data);
28
29
//set series geo id field settings
30
series.labels().format("{%id}");
31
32
series.tooltip().format("{%size} thousands of tourists");
33
34
series.tooltip().titleFormat("{%id}");
35
36
map.title("Most popluar places \n of touristic interest in 2013");
37
38
// change the bubble max size
39
map.maxBubbleSize(45);
40
map.minBubbleSize(15);
41
42
// set container id for the chart
43
map.container('container');
44
// initiate chart drawing
45
map.draw();
46
});