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
stage.width(300);
3
stage.height(150);
4
5
var rectangle = stage.rect(0, 0, stage.width(), stage.height());
6
rectangle.stroke("#F44336");
7
8
var img = stage.image("https://static.anychart.com/images/oceanic-airlines.png", 10, 10, stage.width(), stage.height());
9
img.align("xMidYMid");
10
11
// Gets align.
12
var align = img.align();
13
14
var simpleText = stage.text();
15
simpleText.x(10);
16
simpleText.y(10);
17
simpleText.text("Align is " + align);