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