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
chart.title('Get chart as SVG with predefined width and height');
4
chart.container('container');
5
chart.draw();
6
7
// Get chart as SVG with parameters
8
var SVGstring = chart.toSvg(300, 400);
9
// Now you can do something with this string, send it to the server and etc
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
}