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 chart = anychart.wordtree(getData());
3
4
// Set chart bounds.
5
chart.bounds(new anychart.math.rect(0, 0, 500, 500));
6
7
chart.title('Set chart bounds as a rect object');
8
chart.container('container');
9
chart.draw();
10
});
11
12
function getData() {
13
return [
14
'Earth is round',
15
'Earth is the third planet from the Sun',
16
'Earth goes around the Sun',
17
'Earth has one satellite',
18
'Earth has a radius of 6 371 km',
19
'Earth is less than the Sun',
20
'Earth is less than the Jupiter',
21
'Earth is less than the Saturn',
22
'Earth is less than the Uranus',
23
'Earth is less than the Neptune',
24
'Earth is bigger than the Venus',
25
'Earth is bigger than the Mars',
26
'Earth is bigger than the Mercury',
27
'Earth has a powerful magnetic field'
28
]
29
}