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 rangeStepAreaMapping = dataTable.mapAs({
6
high: 1,
7
low: 3
8
});
9
var lineMapping = dataTable.mapAs({value: 1});
10
11
var chart = anychart.stock();
12
chart.grouping({minPixPerPoint: 5});
13
chart.scrollerGrouping({minPixPerPoint: 5});
14
chart.padding(10, 10, 10, 50);
15
16
var plot = chart.plot();
17
plot.line(lineMapping);
18
19
var scroller = chart.scroller();
20
scroller.height("50%");
21
22
var series = scroller.rangeStepArea(rangeStepAreaMapping);
23
24
// Set series fill.
25
series.fill(["#F44336", "#4CAF50"]);
26
27
chart.title("Set fill parameter as an array. Move the scroller.");
28
chart.container("container");
29
chart.draw();
30
});