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 rangeSplineAreaMapping = 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.rangeSplineArea(rangeSplineAreaMapping);
23
24
series.selectFill("#4CAF50");
25
26
// Get select fill.
27
var selectFill = series.selectFill();
28
29
chart.title({fontColor: selectFill, text: "Get and use select fill."});
30
chart.container("container");
31
chart.draw();
32
});