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