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
// create charts
5
chart1 = anychart.sparkline();
6
chart2 = anychart.sparkline();
7
8
// set container id for the charts
9
chart1.container(stage);
10
chart2.container(stage);
11
12
// setting the titles
13
chart1.title("EUR/USD");
14
chart2.title("GBP/USD");
15
16
// create data for both charts
17
chart1.data([1.1371,1.1341,1.1132,1.1381,1.1371]);
18
chart2.data([1.5500,1.5458,1.5463,1.5397,1.5385]);
19
20
// set charts dimensions and postition
21
chart1.bounds(0, 0, 200, 20);
22
chart2.bounds(0, 25, 200, 20);
23
24
// initiate chart drawing
25
chart1.draw();
26
chart2.draw();
27
});