forked from cuijing1031/Canvas-Gauge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
39 lines (39 loc) · 1.04 KB
/
demo.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
<style>
.panel {
display: block;
margin: 0 auto;
}
</style>
</head>
<body>
<canvas id="my-canvas" class="panel" width="600" height="600"></canvas>
<script src="./gauge.js"></script>
<script>
var my_canvas_obj= document.getElementById("my-canvas");
var gauge= new SOFAGauge({
"tick_length": 20,
"large_tick_length": 30,
"tick_thickness": 1,
"tick_group_length": 9,
"ticks_groups_begin": 0,
"total_degrees": 240,
"total_tick": 101,
"tick_color": "#a6a6ad",
"tick_on_color": "#527d98",
"tick_on_glow": 0,
"bg_image": null,
"gauge_scale": 1,
"animation_duration": 1000,
"percent": 0,
"canvas": my_canvas_obj
});
gauge.render(); //render the configured gauge
gauge.updatePercent(60); //animate the gauge to 60%
</script>
</body>
</html>