-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2fc3cb
commit 7037f11
Showing
8 changed files
with
1,977 additions
and
1,767 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,62 @@ | ||
<div id="gauge"></div> | ||
<!doctype html> | ||
<html> | ||
|
||
<!-- Raphael must be included before justgage --> | ||
<script type="text/javascript" src="./raphael.min.js"></script> | ||
<script type="text/javascript" src="./justgage.js"></script> | ||
|
||
<script> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Differential</title> | ||
<meta name="viewport" content="width=device-width"> | ||
<style> | ||
.container { | ||
width: 600px; | ||
margin: 100px auto; | ||
text-align: center; | ||
} | ||
|
||
var gauge = new JustGage({ | ||
id: "gauge", // the id of the html element | ||
value: 20, | ||
min: -50, | ||
max: 50, | ||
label: "Amps", | ||
decimals: 2, | ||
gaugeWidthScale: 0.6, | ||
differential: true, | ||
pointer: true, | ||
pointerOptions: { | ||
toplength: -30, | ||
bottomlength: 10, | ||
bottomwidth: 10, | ||
color: '#8e8e93', | ||
stroke: '#ffffff', | ||
stroke_width: 2, | ||
stroke_linecap: 'round' | ||
.gauge { | ||
width: 250px; | ||
height: 250px; | ||
display: inline-block; | ||
} | ||
}); | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<div id="gauge"></div> | ||
</div> | ||
<script src="../raphael.min.js"></script> | ||
<script src="../justgage.js"></script> | ||
<script> | ||
document.addEventListener("DOMContentLoaded", function (event) { | ||
|
||
var gauge = new JustGage({ | ||
id: "gauge", // the id of the html element | ||
value: 20, | ||
min: -50, | ||
max: 50, | ||
label: "Amps", | ||
decimals: 2, | ||
gaugeWidthScale: 0.6, | ||
differential: true, | ||
pointer: true, | ||
pointerOptions: { | ||
toplength: -30, | ||
bottomlength: 10, | ||
bottomwidth: 10, | ||
color: '#8e8e93', | ||
stroke: '#ffffff', | ||
stroke_width: 2, | ||
stroke_linecap: 'round' | ||
} | ||
}); | ||
|
||
// update the value randomly | ||
setInterval(() => { | ||
gauge.refresh(Math.random() * 100 - 50); | ||
}, 5000) | ||
|
||
// update the value randomly | ||
setInterval(() => { | ||
gauge.refresh(Math.random() * 100 - 50); | ||
}, 5000) | ||
}); | ||
</script> | ||
</body> | ||
|
||
</script> | ||
</html> |
Oops, something went wrong.