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 dataTable = anychart.data.table();
3
dataTable.addData(get_dji_daily_short_data());
4
5
var data1 = dataTable.mapAs({open: 1, high: 2, low: 3, close: 4});
6
var data2 = dataTable.mapAs({value: 1});
7
8
var chart = anychart.stock();
9
10
chart.grouping({minPixPerPoint: 20});
11
chart.scrollerGrouping({minPixPerPoint: 20});
12
13
var plot = chart.plot();
14
plot.line(data2);
15
16
var scroller = chart.scroller();
17
scroller.height('50%');
18
19
var series = scroller.candlestick(data1);
20
21
// Set falling hatch fill.
22
series.fallingHatchFill(function () {
23
if (this.x < new Date('2006-01-02').getTime())
24
return {type: 'dashed-vertical', color: '#FFFFFF', size: 10}
25
});
26
27
chart.title('Set falling hatch fill parameter as a function');
28
chart.container('container');
29
chart.draw();
30
31
chart.selectRange('2007-01-02', '2010-01-02');
32
});