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
stage.width(120).height(40);
4
5
var rectangle = stage.rect(20, 3, 72, 20);
6
7
// Sets text overflow.
8
var simpleText = stage.text(20, 3, 'Sample text', {
9
fontSize: 14,
10
textOverflow: '...'
11
});
12
simpleText.width(rectangle.getWidth());
13
simpleText.height(rectangle.getHeight());