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
3
// set the data
4
table = anychart.data.table();
5
table.addData(get_dji_daily_short_data());
6
7
// map the data
8
mapping = table.mapAs();
9
mapping.addField('value', 1);
10
11
// chart type
12
var chart = anychart.stock();
13
14
// set the series
15
series = chart.plot(0).area(mapping);
16
series.name("USA population growth");
17
18
chart.title('Stock Area Demo: USA population growth');
19
20
// y-axis labels formatting
21
chart.plot(0).yAxis().labels().format("{%Value}{scale:(1000000)|(m)}");
22
23
grouping = chart.grouping();
24
25
// disable the grouping feature
26
grouping.enabled(false);
27
28
chart.container('container');
29
chart.draw();
30
});