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.diamond(10, 10, 6).stroke('#ffffff');
6
7
var chart = anychart.area();
8
9
var series = chart.stepArea([
10
{x: 'January', value: 125},
11
{x: 'February', value: 132},
12
{x: 'March', value: 141},
13
{x: 'April', value: 158},
14
{x: 'May', value: 133},
15
{x: 'June', value: 143}
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
});