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
24
// Set select low stroke.
25
series.selectLowStroke(function () {
26
return "2 " + anychart.color.darken(this.sourceColor)
27
});
28
29
chart.title("Set low stroke parameter as a function. Move the scroller.");
30
chart.container("container");
31
chart.draw();
32
});