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 rangeAreaMapping = 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.rangeArea(rangeAreaMapping);
23
series.selectHighStroke("#F44336");
24
25
// Get select high stroke.
26
var selectHighStroke = series.selectHighStroke();
27
28
chart.title({fontColor: selectHighStroke, text: "Get and use select high stroke."});
29
chart.container("container");
30
chart.draw();
31
});