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 dataSet = anychart.data.set([
3
{
4
id: "AU.CT",
5
value: 15,
6
title: "Australian Capital Territory",
7
label: {x: 100, y: 80, positionMode: 'offset'}
8
},
9
{id: "AU.VI", value: 23, title: "Victoria"},
10
{id: "AU.WA", value: 86, title: "Western Australia"},
11
{id: "AU.QL", value: 16, title: "Queensland"},
12
{id: "AU.NS", value: 32, title: "New South Wales"},
13
{id: "AU.NT", value: 64, title: "Northern Territory"},
14
{id: "AU.TS", value: 28, title: "Tasmania"},
15
{id: "AU.SA", value: 45, title: "South Australian"}
16
]);
17
18
var dataSetForSeries = dataSet.mapAs({id: "id"});
19
20
var australiaMap = anychart.map();
21
australiaMap.geoData(anychart.maps.australia);
22
23
var series = australiaMap.choropleth(dataSetForSeries);
24
25
var mapLabels = series.labels();
26
mapLabels.enabled(true);
27
mapLabels.position("outside");
28
29
// Set connector stroke.
30
mapLabels.connectorStroke("#424242", 2, "5 2");
31
32
australiaMap.title("Set connector stroke");
33
australiaMap.container("container");
34
australiaMap.draw();
35
});