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
// This sample uses 3rd party Proj4js JavaScript library to transform coordinates
3
// See https://docs.anychart.com/Maps/Map_Projections to learn more.
4
5
var data = [
6
{id: 'AU.CT', value: 15},
7
{id: 'AU.VI', value: 23},
8
{id: 'AU.WA', value: 86},
9
{id: 'AU.QL', value: 16},
10
{id: 'AU.NS', value: 32},
11
{id: 'AU.NT', value: 64},
12
{id: 'AU.TS', value: 28},
13
{id: 'AU.SA', value: 45}
14
];
15
16
var map = anychart.map();
17
map.geoData(anychart.maps.australia);
18
map.choropleth(data);
19
20
// Get hovered state.
21
var state = map.hovered();
22
23
state.labels({enabled: true, fontColor: '#ff0000'});
24
25
map.title('Get and modify hovered state');
26
map.container('container');
27
map.draw();
28
29
map.getSeries(0).hover([0, 2]);
30
});