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 mapping = dataTable.mapAs({value: 1});
6
7
var chart = anychart.stock();
8
9
chart.title('Move the scroller');
10
11
var plot = chart.plot();
12
plot.area(mapping);
13
14
var grouping = chart.grouping();
15
grouping.forced(true);
16
17
chart.listen('selectedrangechange', function () {
18
19
// Get the current data interval and use the title.
20
chart.title('Move the scroller. The current level is ' + grouping.getCurrentDataInterval().unit);
21
});
22
23
chart.container('container');
24
chart.draw();
25
});