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 candlestickMapping = dataTable.mapAs({
6
open: 1,
7
high: 2,
8
low: 3,
9
close: 4
10
});
11
var lineMapping = dataTable.mapAs({value: 1});
12
13
var chart = anychart.stock();
14
chart.padding(10, 10, 10, 50);
15
chart.grouping({minPixPerPoint: 20});
16
chart.scrollerGrouping({minPixPerPoint: 20});
17
18
var plot = chart.plot();
19
plot.line(lineMapping);
20
21
var scroller = chart.scroller();
22
scroller.height("50%");
23
24
var series = scroller.candlestick(candlestickMapping);
25
26
// Set select falling fill.
27
series.selectFallingFill("#F44336", 0.4);
28
29
chart.title("Set select falling fill with opacity.");
30
chart.container("container");
31
chart.draw();
32
});