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 australiaMap = anychart.map();
16
australiaMap.geoData(anychart.maps.australia);
17
18
australiaMap.choropleth(dataSetForSeries);
19
australiaMap.geoIdField("code_hasc");
20
australiaMap.zoom(1.1);
21
22
var interactivity = australiaMap.interactivity();
23
24
// Gets drag value.
25
var value = interactivity.drag();
26
27
australiaMap.title(value);
28
australiaMap.container("container");
29
australiaMap.draw();
30
});