function updateGauge(gaugeId, value) { const needle = document.getElementById(`needle${gaugeId}`); const gaugeText = document.getElementById(`gaugeText${gaugeId}`); const maxGaugeValue = 100; // Maximum value the gauge can display const rotationDegree = ((value / maxGaugeValue) * 180) - 90; // Convert value to degree (-90 to 90) needle.style.transform = `rotate(${rotationDegree}deg)`; gaugeText.textContent = value; // Update the text }