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
{id: "AU.CT", value: 15, title: "Australian Capital Territory"},
11
{id: "AU.VI", value: 23, title: "Victoria"},
12
{id: "AU.WA", value: 86, title: "Western Australia"},
13
{id: "AU.QL", value: 16, title: "Queensland"},
14
{id: "AU.NS", value: 32, title: "New South Wales"},
15
{id: "AU.NT", value: 64, title: "Northern Territory"},
16
{id: "AU.TS", value: 28, title: "Tasmania"},
17
{id: "AU.SA", value: 45, title: "South Australian"}
18
]);
19
20
var dataSetForSeries = dataSet.mapAs({id: "id"});
21
22
var map = anychart.map();
23
map.geoData(anychart.maps.australia);
24
map.choropleth(dataSetForSeries);
25
26
mapScale = map.scale();
27
// set minimum and maximum
28
mapScale.minimumX(110);
29
mapScale.maximumX(157);
30
mapScale.minimumY(-50);
31
mapScale.maximumY(-10);
32
33
34
// Set intervals
35
mapScale.xTicks({interval: 15});
36
mapScale.xMinorTicks({interval: 5});
37
mapScale.yTicks({interval: 15});
38
mapScale.yMinorTicks({interval: 5});
39
40
// enable axes
41
mapAxes = map.axes();
42
mapAxes.enabled(true);
43
mapAxes.ticks(true);
44
mapAxes.minorTicks(true);
45
46
// enable grids
47
map.grids(true);
48
49
map.title("Set Map Scale Minimum and Maximum");
50
map.container("container");
51
map.draw();
52
});