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 stage = anychart.graphics.create('container');
3
4
var dataTable = anychart.data.table();
5
dataTable.addData(get_dji_daily_short_data());
6
7
var mapping = dataTable.mapAs({value: 1});
8
9
var chart1 = anychart.stock();
10
var chart2 = anychart.stock();
11
12
chart1.plot().line(mapping);
13
chart2.plot().line(mapping);
14
15
chart1.selectRange(new Date(2006, 0), new Date(2009, 0));
16
chart2.selectRange(new Date(2006, 0), new Date(2009, 0));
17
18
chart1.title('Chart with enabled plot drag.');
19
chart2.title('Chart with disabled plot drag.');
20
21
chart2.interactivity().allowPlotDrag(false);
22
23
chart1.bounds(0, 0, '50%', '100%');
24
chart2.bounds('50%', 0, '50%', '100%');
25
26
chart1.container(stage);
27
chart2.container(stage);
28
29
chart1.draw();
30
chart2.draw();
31
});