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
var data_1 = [
10
{id: "AU.CT", value: 15},
11
{id: "AU.VI", value: 23},
12
{id: "AU.NT", value: 64},
13
{id: "AU.TS", value: 28},
14
{id: "AU.SA", value: 45}
15
];
16
17
var data_2 = [
18
{id: "AU.WA", value: 86},
19
{id: "AU.QL", value: 16},
20
{id: "AU.NS", value: 32}
21
];
22
23
var map = anychart.map();
24
map.geoData(anychart.maps.australia);
25
26
var firstSeries = map.choropleth(data_1);
27
28
// set the color for the regions of the first series
29
firstSeries.fill('#FFCC99');
30
31
// set the color for the hovered regions of the first series
32
firstSeries.hovered().fill('#FFFF66');
33
34
var secondSeries = map.choropleth(data_2);
35
36
// set the color for the regions of the second series
37
secondSeries.fill('#8CE3B0');
38
39
// set the image for the hovered regions of the second series
40
secondSeries.hovered().fill({
41
src: "https://static.anychart.com/images/oceanic-airlines.png",
42
mode: "stretch",
43
opacity: 0.3
44
});
45
46
map.container("container");
47
map.draw();
48
});