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 data = getData();
3
4
var chart = anychart.treeMap(data);
5
6
// Get chart as an invisible HTML table.
7
// You can use inspect element tool to see the table.
8
var a11yTable = chart.toA11yTable('Chart table');
9
// Do something with an HTML table.
10
11
chart.title('Get chart as an invisible HTML table');
12
chart.container('container');
13
chart.draw();
14
});
15
16
function getData() {
17
return [
18
{
19
name: 'Eurasia',
20
children: [
21
{
22
name: 'Asia', children: [
23
{
24
name: 'Eastern Asia', children: [
25
{name: 'Mongolia', value: 1564116, capital: 'Ulan-Bator'},
26
{name: 'China', value: 1564116, capital: 'Beijing'},
27
{name: 'Southern Korea', value: 1564116, capital: 'Seoul'},
28
{name: 'Northern Korea', value: 120540, capital: 'Pyongyang'},
29
{name: 'Japan', value: 1564116, capital: 'Tokio'}
30
]
31
}
32
]
33
},
34
{
35
name: 'Europe', children: [
36
{
37
name: 'Northern Europe', children: [
38
{name: 'Finland', value: 338424, capital: 'Helsinki'},
39
{name: 'Great Britain', value: 209331, capital: 'London'},
40
{name: 'Ireland', value: 84421, capital: 'Dublin'},
41
{name: 'Scandinavia', value: 928057}
42
]
43
}
44
]
45
}
46
]
47
}
48
];
49
}