Added gauge, fixed shit
Some checks failed
Test compiling project / test (push) Failing after 1m30s

This commit is contained in:
2024-10-24 22:54:54 +02:00
parent 57b1ce8db7
commit db567eeaa5
14 changed files with 413 additions and 223 deletions

View File

@@ -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);