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 chart = anychart.candlestick();
3
4
var series1 = chart.candlestick([
5
{x: Date.UTC(2017, 7, 28), open: 511.53, high: 514.98, low: 505.79, close: 506.40},
6
{x: Date.UTC(2017, 7, 29), open: 507.84, high: 513.30, low: 507.23, close: 512.88},
7
{x: Date.UTC(2017, 7, 30), open: 512.36, high: 515.40, low: 510.58, close: 511.40},
8
{x: Date.UTC(2017, 7, 31), open: 513.10, high: 516.50, low: 511.47, close: 515.25}
9
]);
10
series1.risingHatchFill('zig-zag');
11
12
var series2 = chart.candlestick([
13
{x: Date.UTC(2017, 7, 28), open: 522.95, high: 523.10, low: 519.50, close: 520.52},
14
{x: Date.UTC(2017, 7, 29), open: 522.60, high: 524.69, low: 515.27, close: 517.55},
15
{x: Date.UTC(2017, 7, 30), open: 522.49, high: 522.91, low: 522.38, close: 522.61},
16
{x: Date.UTC(2017, 7, 31), open: 522.81, high: 523.83, low: 520.51, close: 521.73}
17
]);
18
19
// Get rising hatch fill.
20
var risingHatchFill = series1.risingHatchFill();
21
22
series2.risingHatchFill(risingHatchFill);
23
24
chart.xScale().minimum(Date.UTC(2017, 7, 27)).maximum(Date.UTC(2017, 8, 1));
25
chart.title('Get and use rising hatch fill');
26
chart.container('container');
27
chart.draw();
28
});