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
var data = getData();
4
5
chart = anychart.tagCloud(data);
6
7
// To work with exports you need to reference the exports module from AnyChart CDN
8
// (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)
9
10
// Set exports settings.
11
chart.exports({facebook: {caption: 'ANYCHART.COM', description: 'TagCloud chart'}});
12
13
chart.title('Set exports settings');
14
chart.container('container');
15
chart.draw();
16
});
17
18
function getData() {
19
return [
20
{x: 'learning', value: 80},
21
{x: 'lists', value: 44},
22
{x: 'meaning', value: 40},
23
{x: 'useful', value: 36},
24
{x: 'different', value: 32},
25
{x: 'grammar', value: 28},
26
{x: 'teaching', value: 24},
27
{x: 'example', value: 20},
28
{x: 'includes', value: 56},
29
{x: 'thing', value: 12},
30
{x: 'vocabulary', value: 10},
31
{x: 'frequency', value: 10},
32
{x: 'phrases', value: 15},
33
{x: 'content', value: 27}
34
]
35
}