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
var dataSet = anychart.data.set([
3
{id: 'AU.CT', value: 15, title: 'Australian Capital Territory'},
4
{id: 'AU.VI', value: 23, title: 'Victoria'},
5
{id: 'AU.WA', value: 86, title: 'Western Australia'},
6
{id: 'AU.QL', value: 16, title: 'Queensland'},
7
{id: 'AU.NS', value: 32, title: 'New South Wales'},
8
{id: 'AU.NT', value: 64, title: 'Northern Territory'},
9
{id: 'AU.TS', value: 28, title: 'Tasmania'},
10
{id: 'AU.SA', value: 45, title: 'South Australian'}
11
]);
12
13
var dataSetForSeries = dataSet.mapAs({id: 'id'});
14
15
var map = anychart.map();
16
map.geoData(anychart.maps.australia);
17
map.choropleth(dataSetForSeries);
18
19
var callout = map.callout();
20
callout.items(['AU.CT', 'AU.WA', 'AU.NS', 'AU.SA']);
21
callout.padding(10);
22
23
// Set background settings.
24
callout.background({fill: '#F44336'});
25
26
map.title('Set background settings');
27
map.container('container');
28
map.draw();
29
});