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 dataTable = anychart.data.table();
8
dataTable.addData(get_dji_daily_short_data());
9
10
var mapping = dataTable.mapAs({value: 1});
11
12
var chart = anychart.stock();
13
14
var plot = chart.plot();
15
16
var series = plot.splineArea(mapping);
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
});