HTMLcopy
1
<div id="container"></div>
CSScopy
8
1
html,
2
body,
3
#container {
4
width: 100%;
5
height: 100%;
6
margin: 0;
7
padding: 0;
8
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
3
$.ajax("https://gist.githubusercontent.com/awanshrestha/0033cf6344bcda10c242b64fe1d8c2f7/raw/115a11507a1d672fbf651f1bd413963318501010/i-have-a-dream-speech.txt"
4
).done(function (text) {
5
6
// create a word tree chart
7
var chart = anychart.wordtree(text);
8
9
// set the root word
10
chart.word('I');
11
12
// set the chart title
13
chart.title("Word Tree of \"I Have a Dream\" Speech by Martin Luther King");
14
15
// set the container id
16
chart.container("container");
17
18
// initiate the drawing of the word tree chart
19
chart.draw();
20
21
});
22
23
});