HTMLcopy
1
<button onclick="shareWithTwitter();">Get the sharing dialog</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
chart.title('Share with Twitter');
7
chart.container('container');
8
chart.draw();
9
});
10
11
function shareWithTwitter() {
12
13
// Share chart with Twitter.
14
chart.shareWithTwitter();
15
}
16
17
function getData() {
18
return [
19
{x: 'learning', value: 80},
20
{x: 'lists', value: 44},
21
{x: 'meaning', value: 40},
22
{x: 'useful', value: 36},
23
{x: 'different', value: 32},
24
{x: 'grammar', value: 28},
25
{x: 'teaching', value: 24},
26
{x: 'example', value: 20},
27
{x: 'includes', value: 56},
28
{x: 'thing', value: 12},
29
{x: 'vocabulary', value: 10},
30
{x: 'frequency', value: 10},
31
{x: 'phrases', value: 15},
32
{x: 'content', value: 27}
33
]
34
}