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/7.14.3/Maps/Map_Projections
8
9
var dataSet = anychart.data.set([
10
['AU.WA', 300],
11
['AU.JB', 230],
12
['AU.NS', 240],
13
['AU.VI', 275],
14
['AU.NT', 130],
15
['AU.TS', 190],
16
['AU.CT', 100],
17
['AU.SA', 305],
18
['AU.QL', 190]
19
]);
20
21
// mapping the data to the chart
22
var chartDataSet = dataSet.mapAs({x: [0], value: [1]});
23
var mapDataSet = dataSet.mapAs({id: [0], value: [1]});
24
25
var stage = anychart.graphics.create("container");
26
var mapChart = anychart.map();
27
mapChart.geoData(anychart.maps.australia);
28
mapChart.container(stage);
29
mapChart.title('Australia Map');
30
// set the series
31
var series = mapChart.choropleth(mapDataSet);
32
33
// disable the labels
34
series.labels(false);
35
mapChart.bounds(0, 0, '100%', '70%');
36
mapChart.draw();
37
38
var areaChart = anychart.area();
39
areaChart.container(stage);
40
areaChart.title('Spline-Area Chart');
41
areaChart.bounds(0, '70%', '100%', '30%');
42
areaChart.splineArea(chartDataSet);
43
areaChart.draw();
44
45
var yAreaScale = areaChart.yScale();
46
yAreaScale.minimum(0);
47
yAreaScale.maximum(350);
48
49
});