-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
128 lines (119 loc) · 2.46 KB
/
index.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS3饼图</title>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/reset.css">
<link rel="stylesheet" type="text/css" href="css/pie.css">
<style type="text/css">
body{
padding:20px;
}
.fork{
position: fixed;
right: 0;
top: 0;
}
dl{
clear:both;
}
dt{
font-size:30px;
line-height:1.5;
}
dd{
margin-bottom: 20px;
float:left;
}
.pie-wrap{
width: 140px;
height: 200px;
float:left;
margin:10px;
position:relative;
}
.pie-wrap p{
position: absolute;
top: 160px;
width:140px;
text-align: center;
font-size: 20px;
}
</style>
</head>
<body>
<a class="fork" href="https://github.com/lancer07/css3_pie" target="_blank">
<img src="img/forkme.png" width="149" height="149" />
</a>
<dl>
<dt>CSS3饼图</dt>
<dd id="init-pie">
<div class="pie-wrap">
<div class="pie" id="base-pie" data-value="0.2"></div>
<p>Base</p>
</div>
<div class="pie-wrap">
<div class="pie" id="number-pie" data-value="0.95"></div>
<p>Number</p>
</div>
<div class="pie-wrap">
<div class="pie" id="animate-pie" data-value="0.4"></div>
<p>Animate</p>
</div>
<div class="pie-wrap">
<div class="pie" id="ring-pie" data-value="0.6"></div>
<p>Ring</p>
</div>
<div class="pie-wrap">
<div class="pie" id="colorful-pie" data-value="0.8"></div>
<p>ColorFul</p>
</div>
<div class="pie-wrap">
<div class="pie" id="rotate-pie" data-value="0.3"></div>
<p>Rotate</p>
</div>
</dd>
</dl>
</body>
<script type="text/javascript" src="js/pie-1.0.1.js"></script>
<!-- 初始化各种百分比的饼状图 -->
<script type="text/javascript">
var pie1 = new Pie({
el : '#base-pie',
number :false
});
pie1.init();
var pie1 = new Pie({
el : '#number-pie'
});
pie1.init();
var pie3 = new Pie({
el : '#animate-pie',
animite : true,
number :false
});
pie3.init();
var pie4 = new Pie({
el : '#ring-pie',
animite : true,
ring : 0.5
});
pie4.init();
var pie5 = new Pie({
el : '#colorful-pie',
animite : true,
ring : 0.7,
color : '#ff9933'
});
pie5.init();
var pie6 = new Pie({
el : '#rotate-pie',
animite : true,
ring : 0.8,
color : '#ff6699',
rotate : -40
});
pie6.init();
</script>
</html>