-
Notifications
You must be signed in to change notification settings - Fork 1
/
zhexiantu-canvas.html
53 lines (48 loc) · 1.04 KB
/
zhexiantu-canvas.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
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
<style>
#wa-jiaoyu-canvas{
width:100%;
height: 150px;
}
.wa-jiaoyu-wrap{
position: relative;
}
</style>
</head>
<body>
<canvas id="wa-jiaoyu-canvas"></canvas>
<script src="js/zhexiantu-canvas.js"></script>
<script>
var z1 = new zhexiantu("#wa-jiaoyu-canvas",{
xlen:5,
ylen:3,
unitHeight:38,
startX:30,
afterDraw:function(ctx){
alert("a") ;
},
tableXstr:"经验(年)",
lines:[
{
beforeDraw:function(ctx){
ctx.strokeStyle = "#ff6600";
ctx.fillStyle = "#ff6600";
},
points: [ { x:0, y:3999 }, { x:1, y:4782 }, { x:2, y:7000 }, { x:3, y:8888 }, { x:4, y:13239 }, { x:5, y:15000 } ]
},
{
beforeDraw:function(ctx){
ctx.strokeStyle = "#1f91ff";
ctx.fillStyle = "#1f91ff";
},
points:[ { x:0, y:2999 }, { x:1, y:3782 }, { x:2, y:6000 }, { x:3, y:7888 }, { x:4, y:10239 }, { x:5, y:14000 } ]
}
]
});
</script>
</body>
</html>