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 stage = anychart.graphics.create('container');
6
7
var pattern = stage.pattern(new anychart.graphics.math.Rect(0, 0, 20, 20));
8
pattern.star5(11, 7, 8).stroke('#fffaf0');
9
10
var dataSet = anychart.data.set([
11
{id: 'AU.CT', value: 15, title: 'Australian Capital Territory'},
12
{id: 'AU.VI', value: 23, title: 'Victoria'},
13
{id: 'AU.WA', value: 86, title: 'Western Australia'},
14
{id: 'AU.QL', value: 16, title: 'Queensland'},
15
{id: 'AU.NS', value: 32, title: 'New South Wales'},
16
{id: 'AU.NT', value: 64, title: 'Northern Territory'},
17
{id: 'AU.TS', value: 28, title: 'Tasmania'},
18
{id: 'AU.SA', value: 45, title: 'South Australian'}
19
]);
20
21
var map = anychart.map();
22
map.geoData(anychart.maps.australia);
23
24
var series = map.choropleth(dataSet);
25
26
// Set hatch fill.
27
series.hatchFill(pattern);
28
29
map.title('Set hatch fill as a pattern');
30
map.container(stage);
31
map.draw();
32
});