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 lineMapping = dataTable.mapAs({value: 1});
6
7
var ohlcMapping = dataTable.mapAs({
8
open: 1,
9
high: 2,
10
low: 3,
11
close: 4
12
});
13
14
var chart = anychart.stock();
15
chart.padding(10, 10, 10, 50);
16
17
var plot = chart.plot();
18
plot.line(lineMapping);
19
20
var scroller = chart.scroller();
21
// Adds ohlc series.
22
scroller.ohlc(ohlcMapping);
23
24
chart.container("container");
25
chart.draw();
26
});