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 data = getData();
3
4
var chart = anychart.tagCloud(data);
5
6
// Set title text.
7
chart.title('Set title parameter as a string');
8
9
chart.container('container');
10
chart.draw();
11
});
12
13
function getData() {
14
return [
15
{x: 'learning', value: 80},
16
{x: 'lists', value: 44},
17
{x: 'meaning', value: 40},
18
{x: 'useful', value: 36},
19
{x: 'different', value: 32},
20
{x: 'grammar', value: 28},
21
{x: 'teaching', value: 24},
22
{x: 'example', value: 20},
23
{x: 'includes', value: 56},
24
{x: 'thing', value: 12},
25
{x: 'vocabulary', value: 10},
26
{x: 'frequency', value: 10},
27
{x: 'phrases', value: 15},
28
{x: 'content', value: 27}
29
]
30
}