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
// configure the chart title
13
chart
14
.title()
15
.enabled(true)
16
.useHtml(true)
17
.text("<span style = 'color: #2b2b2b; font-size:20px;'>Word Tree of \"I Have a Dream\" Speech by Martin Luther King</span>");
18
19
// configure the font size and color
20
chart.fontColor("#0daf8d");
21
chart.fontWeight(500);
22
chart.fontStyle("italic");
23
chart.minFontSize(8);
24
chart.maxFontSize(16);
25
26
// set the container id
27
chart.container("container");
28
29
// initiate the drawing of the word tree chart
30
chart.draw();
31
32
});
33
34
});