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
var secondSeries = map.choropleth(data_2);
32
33
// set the color for the regions of the second series
34
secondSeries.fill('#8CE3B0');
35
36
map.container("container");
37
map.draw();
38
});