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
// create charts and set data
4
var chart1 = anychart.sparkline([1.1371,1.1341,1.1132,1.1381,1.1371]); // eur\usd feb
5
var chart2 = anychart.sparkline([1.5500,1.5458,1.5463,1.5397,1.5385]); // gbp\usd feb
6
var chart3 = anychart.sparkline([0.1639,0.1675,0.1612,0.1585,0.1549]); // cny\usd feb
7
var chart4 = anychart.sparkline([1.3608,1.3628,1.3604,1.3610,1.3606]); // eur\usd june
8
var chart5 = anychart.sparkline([1.67,1.67,1.68,1.68,1.67]); // gbp\usd june
9
var chart6 = anychart.sparkline([0.2738,0.2723,0.2755,0.2721,0.2680]); // cny\usd june
10
11
// create table
12
var table = anychart.standalones.table();
13
14
// set table content
15
table.contents([
16
[
17
null,
18
"February",
19
"June"
20
],[
21
"EUR/USD",
22
chart1,
23
chart4
24
],[
25
"GBP/USD",
26
chart2,
27
chart5
28
],[
29
"CNY/USD",
30
chart3,
31
chart6
32
]
33
]);
34
35
table.getRow(0).height("25%"); // Get first row and set height 25%
36
table.getCol(0).width(70); // Get first column and set width 70 px
37
38
table
39
.cellBorder("#B8B8B8") // Adjust table border
40
.vAlign("center") // Position text into the center
41
.hAlign("center") // Position text into the center
42
.fontWeight(900) // Bold text
43
.height(100) // Set table height
44
.width(200); // Set table width
45
46
// set table container and initiate draw
47
table.container("container").draw();
48
});