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.NT", value: 64},
11
{id: "AU.TS", value: 28}
12
];
13
14
var data_2 = [
15
{id: "AU.WA", value: 86},
16
{id: "AU.SA", value: 45}
17
18
];
19
20
var data_3 = [
21
{id: "AU.QL", value: 16},
22
{id: "AU.NS", value: 32}
23
];
24
25
var data_4 = [
26
{id: "AU.CT", value: 15},
27
{id: "AU.VI", value: 23}
28
];
29
30
var map = anychart.map();
31
map.geoData(anychart.maps.australia);
32
33
// Creates palette
34
var myPalette = anychart.palettes.rangeColors();
35
myPalette.items(["#B2DFDB", "#00796B"]);
36
myPalette.count(4);
37
38
// Sets palette.
39
map.palette(myPalette);
40
41
map.choropleth(data_1);
42
map.choropleth(data_2);
43
map.choropleth(data_3);
44
map.choropleth(data_4);
45
46
map.container("container");
47
map.draw();
48
});