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
3
// create data
4
var data = [
5
["oxygen is a chemical element"],
6
["in nature, oxygen is a gas with no color or smell"],
7
["oxygen is a very important element"],
8
["oxygen was initially discovered in 1772"],
9
["oxygen is what makes burning possible"],
10
["oxygen can be used in smelting metal from ore"],
11
["oxygen is used in hospitals for killing bacteria"],
12
["oxygen is used to purify the water"],
13
["in nature, oxygen is produced by plants"]
14
];
15
16
// create a chart and set the data
17
var chart = anychart.wordtree(data);
18
19
// configure the font
20
chart.maxFontSize(20);
21
22
// set the chart title
23
chart.title("Word Tree: Data (Arrays)");
24
25
// set the container id
26
chart.container("container");
27
28
// initiate drawing the chart
29
chart.draw();
30
});