-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathexample.html
61 lines (56 loc) · 1.32 KB
/
example.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Circle Chart</title>
<style>
.charts-container {
max-width: 500px;
margin: 0 auto;
}
.circle-chart {
width: 25%;
min-width: 100px;
position: relative;
display: inline-block;
margin-right: 1em;
}
.circle-chart__text {
position: absolute;
width: 100%;
height: 100%;
text-align: center;
left: 0;
top: 0;
line-height: 4;
font-family: sans-serif;
}
</style>
</head>
<body>
<div class="charts-container">
<div class="circle-chart circle-chart--default">
66.7%
</div>
<div class="circle-chart circle-chart--with-border">
50%
</div>
<div class="circle-chart circle-chart--with-track">
33.3%
</div>
</div>
<script src="bower_components/raphael/raphael-min.js"></script>
<script src="js/circle-chart.js"></script>
<script>
window.onload = function () {
var el, c1, c2, c3;
el = document.querySelector('.circle-chart--default');
c1 = new CircleChart(el);
el = document.querySelector('.circle-chart--with-border');
c2 = new CircleChart(el, { edgeWidth: 3 });
el = document.querySelector('.circle-chart--with-track');
c3 = new CircleChart(el, { trackColour: '#efefef' });
};
</script>
</body>
</html>