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 stage = anychart.graphics.create('container');
3
4
var pattern = stage.pattern(new anychart.graphics.math.Rect(0, 0, 20, 20));
5
pattern.star5(11, 7, 8).stroke('#fffaf0');
6
7
var chart = anychart.polar();
8
9
var series = chart.polygon([
10
{x: 0, value: 2},
11
{x: 1, value: 1},
12
{x: 2, value: 2},
13
{x: 3, value: 3},
14
{x: 4, value: 2},
15
{x: 5, value: 1}
16
]);
17
18
// Set hatch fill.
19
series.hatchFill(pattern);
20
21
chart.title('Set hatch fill as a pattern');
22
chart.container(stage);
23
chart.draw();
24
});