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
// This sample uses 3rd party Proj4js JavaScript library to transform coordinates
3
// See https://docs.anychart.com/Maps/Map_Projections to learn more.
4
5
var dataSet = anychart.data.set([
6
{id: 'FR.AO', title: 'Strasbourg', value: 928},
7
{id: 'FR.AC', title: 'Bordeaux', value: 192},
8
{id: 'FR.AR', title: 'Lyon', value: 963},
9
{id: 'FR.PL', title: 'Nantes', value: 266},
10
{id: 'FR.BF', title: 'Dijon', value: 518},
11
{id: 'FR.BT', title: 'Rennes', value: 324}
12
]);
13
14
var map = anychart.map();
15
map.geoData(anychart.maps.france);
16
17
var series = map.choropleth(dataSet);
18
19
map.container('container');
20
map.draw();
21
22
var point = series.getPoint(0);
23
24
// Gets scale of the point.
25
var scaleValue = point.scaleFactor();
26
27
map.title('Scale factor is ' + scaleValue);
28
});