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 a triangle
4
triangle = stage.triangleUp(110, 95, 80);
5
triangle.fill("#d77d31");
6
triangle.stroke(null);
7
8
// get the triangle center point
9
triangleCenterX = triangle.getBounds().getLeft()+triangle.getBounds().getWidth()/2;
10
triangleCenterY = triangle.getBounds().getTop()+triangle.getBounds().getHeight()/2;
11
12
// create a circle
13
circle = stage.circle(triangleCenterX, triangleCenterY, 20);
14
circle.fill("#8ccb5e");
15
circle.stroke(null);