<div id="container"></div>
html, body, #container {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
var stage = acgraph.create('container');
stage.width(120).height(40);
var rectangle = stage.rect(20, 3, 72, 20);
// Sets text overflow.
var simpleText = stage.text(20, 3, 'Sample text', {
fontSize: 14,
textOverflow: '...'
});
simpleText.width(rectangle.getWidth());
simpleText.height(rectangle.getHeight());