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 label text by index 0.
5
chart.label(0, 'Label by index 0');
6
7
chart.label(1, {offsetX: 120, text: 'Label by index 1'});
8
9
chart.title('Set chart label parameter as string by index');
10
chart.container('container');
11
chart.draw();
12
});
13
14
function getData() {
15
return [
16
'Earth is round',
17
'Earth is the third planet from the Sun',
18
'Earth goes around the Sun',
19
'Earth has one satellite',
20
'Earth has a radius of 6 371 km',
21
'Earth is less than the Sun',
22
'Earth is less than the Jupiter',
23
'Earth is less than the Saturn',
24
'Earth is less than the Uranus',
25
'Earth is less than the Neptune',
26
'Earth is bigger than the Venus',
27
'Earth is bigger than the Mars',
28
'Earth is bigger than the Mercury',
29
'Earth has a powerful magnetic field'
30
]
31
}