| 21627 |
kshitij.so |
1 |
<!doctype html>
|
|
|
2 |
<html>
|
|
|
3 |
<head>
|
|
|
4 |
<meta charset="utf-8">
|
|
|
5 |
<title>Easy Pie Chart</title>
|
|
|
6 |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
|
|
|
7 |
<script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
|
8 |
<script type="text/javascript" src="excanvas.js"></script>
|
|
|
9 |
<script type="text/javascript" src="../jquery.easy-pie-chart.js"></script>
|
|
|
10 |
|
|
|
11 |
<link rel="stylesheet" type="text/css" href="style.css" media="screen">
|
|
|
12 |
<link rel="stylesheet" type="text/css" href="../jquery.easy-pie-chart.css" media="screen">
|
|
|
13 |
|
|
|
14 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
15 |
|
|
|
16 |
<script type="text/javascript">
|
|
|
17 |
var initPieChart = function() {
|
|
|
18 |
$('.percentage').easyPieChart({
|
|
|
19 |
animate: 1000
|
|
|
20 |
});
|
|
|
21 |
$('.percentage-light').easyPieChart({
|
|
|
22 |
barColor: function(percent) {
|
|
|
23 |
percent /= 100;
|
|
|
24 |
return "rgb(" + Math.round(255 * (1-percent)) + ", " + Math.round(255 * percent) + ", 0)";
|
|
|
25 |
},
|
|
|
26 |
trackColor: '#666',
|
|
|
27 |
scaleColor: false,
|
|
|
28 |
lineCap: 'butt',
|
|
|
29 |
lineWidth: 15,
|
|
|
30 |
animate: 1000
|
|
|
31 |
});
|
|
|
32 |
|
|
|
33 |
$('.updateEasyPieChart').on('click', function(e) {
|
|
|
34 |
e.preventDefault();
|
|
|
35 |
$('.percentage, .percentage-light').each(function() {
|
|
|
36 |
var newValue = Math.round(100*Math.random());
|
|
|
37 |
$(this).data('easyPieChart').update(newValue);
|
|
|
38 |
$('span', this).text(newValue);
|
|
|
39 |
});
|
|
|
40 |
});
|
|
|
41 |
};
|
|
|
42 |
</script>
|
|
|
43 |
</head>
|
|
|
44 |
<body onload="initPieChart();">
|
|
|
45 |
<div class="container">
|
|
|
46 |
<h1>EASY PIE CHART</h1>
|
|
|
47 |
<div class="chart">
|
|
|
48 |
<div class="percentage success" data-percent="55"><span>55</span>%</div>
|
|
|
49 |
<div class="label">New visits</div>
|
|
|
50 |
</div>
|
|
|
51 |
<div class="chart">
|
|
|
52 |
<div class="percentage" data-percent="46"><span>46</span>%</div>
|
|
|
53 |
<div class="label">Bounce rate</div>
|
|
|
54 |
</div>
|
|
|
55 |
<div class="chart">
|
|
|
56 |
<div class="percentage" data-percent="92"><span>92</span>%</div>
|
|
|
57 |
<div class="label">Server load</div>
|
|
|
58 |
</div>
|
|
|
59 |
<div class="chart">
|
|
|
60 |
<div class="percentage" data-percent="84"><span>752</span>MB</div>
|
|
|
61 |
<div class="label">Used RAM</div>
|
|
|
62 |
</div>
|
|
|
63 |
<div style="clear:both;"></div>
|
|
|
64 |
<div class="dark">
|
|
|
65 |
<div class="chart">
|
|
|
66 |
<div id="sparkline_bar" class="percentage-light" data-percent="55"><span>55</span>%</div>
|
|
|
67 |
<div class="label">New visits</div>
|
|
|
68 |
</div>
|
|
|
69 |
<div class="chart">
|
|
|
70 |
<div id="sparkline_bar" class="percentage-light" data-percent="46"><span>46</span>%</div>
|
|
|
71 |
<div class="label">Bounce rate</div>
|
|
|
72 |
</div>
|
|
|
73 |
<div class="chart">
|
|
|
74 |
<div class="percentage-light" data-percent="92"><span>92</span>%</div>
|
|
|
75 |
<div class="label">Server load</div>
|
|
|
76 |
</div>
|
|
|
77 |
<div class="chart">
|
|
|
78 |
<div class="percentage-light" data-percent="84"><span>752</span>MB</div>
|
|
|
79 |
<div class="label">Used RAM</div>
|
|
|
80 |
</div>
|
|
|
81 |
<div style="clear:both;"></div>
|
|
|
82 |
</div>
|
|
|
83 |
|
|
|
84 |
<p><a href="#" class="button updateEasyPieChart">Update pie charts</a></p>
|
|
|
85 |
|
|
|
86 |
<p class="credits">Inspired by: <a href="http://drbl.in/ezuc" target="_blank">Simple Pie Charts II by Rafal Bromirski on dribble</a></p>
|
|
|
87 |
</div>
|
|
|
88 |
</body>
|
|
|
89 |
</html>
|