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
var data = [
3
{'id': 'AU.WA', 'value': 300},
4
{'id': 'AU.JB', 'value': 270},
5
{'id': 'AU.NS', 'value': 240},
6
{'id': 'AU.VI', 'value': 75},
7
{'id': 'AU.NT', 'value': 130},
8
{'id': 'AU.TS', 'value': 190},
9
{'id': 'AU.CT', 'value': 100},
10
{'id': 'AU.SA', 'value': 280},
11
{'id': 'AU.QL', 'value': 220}
12
];
13
14
// create map
15
var map = anychart.map();
16
map.geoData(anychart.maps.australia);
17
18
// set the title and its preferences
19
map.title('Linear Color Scale');
20
21
// set the series
22
var series = map.choropleth(data);
23
series.stroke("2 white 0");
24
series.colorScale(anychart.scales.linearColor('#EC6E07', '#64B5F6'));
25
26
// set the container
27
map.container('container');
28
map.draw();
29
});