HTMLcopy
1
<button onclick="chart.shareWithFacebook();">Share with Facebook</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
5
// To work with exports you need to reference the exports module from AnyChart CDN
6
// (https://cdn.anychart.com/releases/8.13.0/js/anychart-exports.min.js for latest or https://cdn.anychart.com/releases/8.13.0/js/anychart-exports.min.js for the versioned file)
7
8
// Set exports settings.
9
chart.exports({facebook: {caption: 'ANYCHART.COM', description: 'Wordtree chart'}});
10
11
chart.container('container');
12
chart.draw();
13
});
14
15
function getData() {
16
return [
17
'Earth is round',
18
'Earth is the third planet from the Sun',
19
'Earth goes around the Sun',
20
'Earth has one satellite',
21
'Earth has a radius of 6 371 km',
22
'Earth is less than the Sun',
23
'Earth is less than the Jupiter',
24
'Earth is less than the Saturn',
25
'Earth is less than the Uranus',
26
'Earth is less than the Neptune',
27
'Earth is bigger than the Venus',
28
'Earth is bigger than the Mars',
29
'Earth is bigger than the Mercury',
30
'Earth has a powerful magnetic field'
31
]
32
}