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
chart.padding(10, 10, 10, 50);
9
chart.scroller(false);
10
11
var plot = chart.plot();
12
plot.line(mapping);
13
plot.width("25%");
14
15
var plotXAxis = plot.xAxis();
16
// Sets mode for overlapMode.
17
plotXAxis.overlapMode(anychart.enums.StockLabelsOverlapMode.ALLOW_OVERLAP);
18
19
chart.container("container");
20
chart.draw();
21
});