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
firstSeries.fill('#FFCC99');
28
29
var secondSeries = map.choropleth(data_2);
30
secondSeries.fill('#8CE3B0');
31
32
// set the color for the selections of the first series
33
firstSeries.selected().fill("#FFA875");
34
35
// set the color for the selections of the second series
36
secondSeries.selected().fill("#4CF0BD");
37
38
map.container("container");
39
map.draw();
40
});