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
var stage = acgraph.create("container");
2
3
// create the text style object
4
textStyle = {fontFamily: "Georgia", fontSize: "15px", color: "green", letterSpacing: "3px", lineHeight: "10px"};
5
6
/// create a text element as HTML
7
text1 = stage.text().htmlText("<p fontFace='Dancing Script'>This is my custom text,<br>which has several lines, separated<br>with the <br> tags.</p>");
8
9
// create the second text
10
text2 = stage.text(20, 50, "This is my second custom text element, which is made multiline with the help of AnyChart Graphics methods", textStyle);
11
12
// text settings
13
text2.width(150);
14
text2.height(150);
15
text2.textOverflow("...");
16
text2.wordWrap("break-word");
17
text2.wordBreak("normal");