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 left bound
7
chart.left('10%');
8
9
// Set right bound
10
chart.right('10%');
11
12
// Set top bound
13
chart.top('20%');
14
15
// Set bottom bound
16
chart.bottom('20%');
17
18
chart.title('Set left/right/top/bottom bound');
19
chart.container('container');
20
chart.draw();
21
});
22
23
function getData() {
24
return [
25
{x: 'learning', value: 80},
26
{x: 'lists', value: 44},
27
{x: 'meaning', value: 40},
28
{x: 'useful', value: 36},
29
{x: 'different', value: 32},
30
{x: 'grammar', value: 28},
31
{x: 'teaching', value: 24},
32
{x: 'example', value: 20},
33
{x: 'includes', value: 56},
34
{x: 'thing', value: 12},
35
{x: 'vocabulary', value: 10},
36
{x: 'frequency', value: 10},
37
{x: 'phrases', value: 15},
38
{x: 'content', value: 27}
39
]
40
}