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 = [
3
{x: "learning", value: 80},
4
{x: "lists", value: 44},
5
{x: "meaning", value: 40},
6
{x: "useful", value: 36},
7
{x: "different", value: 32},
8
{x: "grammar", value: 28},
9
{x: "teaching", value: 24},
10
{x: "example", value: 20},
11
{x: "includes", value: 56},
12
{x: "thing", value: 12},
13
{x: "vocabulary", value: 10},
14
{x: "frequency", value: 10},
15
{x: "phrases", value: 15},
16
{x: "content", value: 27}
17
];
18
19
var chart = anychart.tagCloud(data);
20
21
// Get hovered state.
22
var hoveredState = chart.hovered();
23
24
hoveredState.fill('#80DEEA');
25
hoveredState.stroke('#5A9BA4');
26
27
chart.title('Get and modify hovered state');
28
chart.container('container');
29
chart.draw();
30
31
chart.hover([0, 2, 4, 6]);
32
});