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
17
1
var stage = acgraph.create("container");
2
var fillSettings = {
3
keys: [".1 red", ".5 green", ".9 blue"],
4
angle: -45,
5
mode: acgraph.math.Rect(5, 0, 395, 200),
6
opacity: .2
7
};
8
stage
9
.rect(5, 0, 395, 200)
10
.fill(fillSettings);
11
fillSettings.opacity = 1;
12
stage.text(20, 3, "shape 1");
13
stage.rect(20, 20, 100, 70).fill(fillSettings);
14
stage.text(60, 120, "shape 2");
15
stage.rect(60, 140, 70, 50).fill(fillSettings);
16
stage.text(270, 73, "shape 3");
17
stage.rect(270, 93, 100, 100).fill(fillSettings);