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: 'AU.CT', value: 15, title: 'Australian Capital Territory'},
7
{id: 'AU.VI', value: 23, title: 'Victoria'},
8
{id: 'AU.WA', value: 86, title: 'Western Australia'},
9
{id: 'AU.QL', value: 16, title: 'Queensland'},
10
{id: 'AU.NS', value: 32, title: 'New South Wales'},
11
{id: 'AU.NT', value: 64, title: 'Northern Territory'},
12
{id: 'AU.TS', value: 28, title: 'Tasmania'}
13
]);
14
15
var map = anychart.map();
16
map.geoData(anychart.maps.australia);
17
18
var series = map.choropleth(dataSet);
19
20
var unboundRegions = map.unboundRegions();
21
22
// Set fill.
23
unboundRegions.fill({
24
src: 'https://static.anychart.com/images/beach.png',
25
mode: 'stretch',
26
opacity: 0.3
27
});
28
29
map.title('Set fill as an image');
30
map.container('container');
31
map.draw();
32
});