forked from ecomfe/zrender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhorizontalLine.html
42 lines (41 loc) · 1002 Bytes
/
horizontalLine.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Event</title>
<script type="text/javascript" src="esl.js"></script>
</head>
<body>
<div id="main" style="width:1000px;height:500px;"></div>
<script type="text/javascript">
require.config({
packages: [
{
name: 'zrender',
location: '../src',
main: 'zrender'
}
]
});
require(
[
'zrender',
'zrender/graphic/shape/Line',
'zrender/container/Group'
],
function(zrender, LineShape, Group){
// 初始化zrender
var zr = zrender.init(document.getElementById('main'));
var line = new LineShape({
shape: {
x1: 30,
y1: 50,
x2: 100,
y2: 50
}
});
zr.add(line);
});
</script>
</body>
</html>