forked from alixaxel/ArrestDB
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgauges.html
40 lines (40 loc) · 1.35 KB
/
gauges.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="scripts/gauge.min.js"></script>
<title>Gauges</title>
</head>
<body>
<canvas id="foo" width="200" height="100" style="border:0px solid #000000;">
</canvas>
<div id="gauge"></div>
</body>
<script>
document.onreadystatechange = function () {
if (document.readyState == "complete") {
var opts = {
lines: 12, // The number of lines to draw
angle: 0.15, // The length of each line
lineWidth: 0.44, // The line thickness
pointer: {
length: 0.9, // The radius of the inner circle
strokeWidth: 0.035, // The rotation offset
color: '#000000' // Fill color
},
limitMax: 'false', // If true, the pointer will not go past the end of the gauge
colorStart: '#6FADCF', // Colors
colorStop: '#8FC0DA', // just experiment with them
strokeColor: '#E0E0E0', // to see which ones work best for you
generateGradient: true
};
var target = document.getElementById('foo'); // your canvas element
var gauge = new Gauge(target).setOptions(opts); // create sexy gauge!
gauge.maxValue = 3000; // set max gauge value
gauge.animationSpeed = 32; // set animation speed (32 is default value)
gauge.setTextField(document.getElementById("gauge"));
gauge.set(1250); // set actual value
}
}
</script>
</html>