This commit is contained in:
@@ -82,10 +82,59 @@ window.addEventListener('DOMContentLoaded', (event) => {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
fetchData(); // fetch immediately on page load
|
||||
setInterval(fetchData, 5000); // fetch every 5 seconds
|
||||
});
|
||||
|
||||
function roundToTwo(num) {
|
||||
return Math.round(num*100)/100;
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('load', function () {
|
||||
var gauge = new RadialGauge({
|
||||
renderTo: 'main_gauge',
|
||||
width: 300,
|
||||
height: 300,
|
||||
units: "l",
|
||||
minValue: 0,
|
||||
maxValue: 220,
|
||||
majorTicks: [
|
||||
"0",
|
||||
"20",
|
||||
"40",
|
||||
"60",
|
||||
"80",
|
||||
"100",
|
||||
"120",
|
||||
"140",
|
||||
"160",
|
||||
"180",
|
||||
"200",
|
||||
"220"
|
||||
],
|
||||
minorTicks: 2,
|
||||
strokeTicks: true,
|
||||
highlights: [
|
||||
{
|
||||
"from": 160,
|
||||
"to": 220,
|
||||
"color": "rgba(200, 50, 50, .75)"
|
||||
}
|
||||
],
|
||||
colorPlate: "#fff",
|
||||
borderShadowWidth: 0,
|
||||
borders: false,
|
||||
needleType: "arrow",
|
||||
needleWidth: 2,
|
||||
needleCircleSize: 7,
|
||||
needleCircleOuter: true,
|
||||
needleCircleInner: false,
|
||||
animationDuration: 1500,
|
||||
animationRule: "linear"
|
||||
}).draw();
|
||||
})
|
||||
|
||||
|
||||
// document.body.appendChild(gauge.options.renderTo);
|
||||
Reference in New Issue
Block a user