HTMLcopy
1
<button onclick="shareAsPdf();">Get the link to PDF file</button>
2
<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
var chart;
2
anychart.onDocumentReady(function () {
3
chart = anychart.wordtree(getData());
4
chart.title('Share chart as PDF image');
5
chart.container('container');
6
chart.draw();
7
});
8
9
function shareAsPdf() {
10
11
// Share chart as PDF file.
12
chart.shareAsPdf(function (response) {
13
alert(response);
14
});
15
}
16
17
function getData() {
18
return [
19
'Earth is round',
20
'Earth is the third planet from the Sun',
21
'Earth goes around the Sun',
22
'Earth has one satellite',
23
'Earth has a radius of 6 371 km',
24
'Earth is less than the Sun',
25
'Earth is less than the Jupiter',
26
'Earth is less than the Saturn',
27
'Earth is less than the Uranus',
28
'Earth is less than the Neptune',
29
'Earth is bigger than the Venus',
30
'Earth is bigger than the Mars',
31
'Earth is bigger than the Mercury',
32
'Earth has a powerful magnetic field'
33
]
34
}