HTMLcopy
1
<div id="container"></div>
CSScopy
8
1
html,
2
body,
3
#container {
4
width: 100%;
5
height: 100%;
6
margin: 0;
7
padding: 0;
8
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
// The data used in this sample can be obtained from the CDN
3
// https://cdn.anychart.com/samples/maps-projections/bubble-map-with-bonne-projection/data.json
4
anychart.data.loadJsonFile(
5
'https://cdn.anychart.com/samples/maps-projections/bubble-map-with-bonne-projection/data.json',
6
function (data) {
7
var map = anychart.map();
8
9
map
10
.crs('bonne')
11
.geoData('anychart.maps.world_source')
12
.background(false);
13
14
map
15
.title()
16
.enabled(true)
17
.useHtml(true)
18
.fontSize(18)
19
.text('Starbucks Distribution by Country');
20
21
map
22
.credits()
23
.enabled(true)
24
.url(
25
'https://opendata.socrata.com/Business/All-Starbucks-Locations-in-the-World/xy4y-c4mk'
26
)
27
.text('Data source: https://opendata.socrata.com')
28
.logoSrc(
29
'https://opendata.socrata.com/stylesheets/images/common/favicon.ico'
30
);
31
32
map.interactivity().selectionMode('none');
33
34
// Sets bubble max size settings
35
map.minBubbleSize('0.5%').maxBubbleSize('5%');
36
37
var dataSet = anychart.data.set(data);
38
var series = map
39
.bubble(dataSet)
40
.fill('#9b301c')
41
.stroke('1.5 #482311');
42
series.tooltip().format(function () {
43
return (
44
'Number of Starbucks: ' +
45
anychart.format.number(this.size, { groupsSeparator: ',' })
46
);
47
});
48
49
// create zoom controls
50
var zoomController = anychart.ui.zoom();
51
zoomController.render(map);
52
53
// Sets container id for the chart
54
map.container('container');
55
// Initiates chart drawing
56
map.draw();
57
}
58
);
59
});