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(10, 10, 8).stroke('#fffaf0');
6
7
var chart = anychart.candlestick();
8
9
var series = chart.candlestick([
10
{x: Date.UTC(2017, 2, 25), open: 511.53, high: 514.98, low: 505.79, close: 506.40},
11
{x: Date.UTC(2017, 2, 26), open: 507.84, high: 513.30, low: 507.23, close: 512.88},
12
{x: Date.UTC(2017, 2, 27), open: 512.36, high: 515.40, low: 510.58, close: 511.40},
13
{x: Date.UTC(2017, 2, 28), open: 515.02, high: 520.50, low: 511.47, close: 517.25}
14
]);
15
16
chart.xScale({minimum: Date.UTC(2017, 2, 24), maximum: Date.UTC(2017, 2, 29)});
17
18
var state = series.normal();
19
20
// Set rising hatch fill.
21
state.risingHatchFill(pattern);
22
23
chart.title('Set state rising hatch fill as a pattern');
24
chart.container(stage);
25
chart.draw();
26
});