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
chart.grouping({minPixPerPoint: 20});
10
chart.scrollerGrouping({minPixPerPoint: 20});
11
12
var plot = chart.plot();
13
plot.ohlc(data1);
14
15
var scroller = chart.scroller();
16
17
var series = scroller.jumpLine(data2);
18
19
// Get stroke settings.
20
var stroke = series.stroke();
21
22
chart.title({text: 'Get and use stroke', background: {stroke: '2 ' + stroke}});
23
chart.container('container');
24
chart.draw();
25
26
chart.selectRange('2009');
27
});