Change adValue for always summing up values received

This commit is contained in:
Your Name
2025-10-21 11:23:23 -04:00
parent f46a1c910b
commit 5f456c0d0b

View File

@@ -63,21 +63,11 @@ class ASCIIBarChart {
* @param {number} value - The numeric value to add
*/
addValue(value) {
if (this.useBinMode) {
// Time bin mode: increment count in current active bin
this.checkBinRotation(); // Ensure we have an active bin
this.bins[this.currentBinIndex].count++;
this.totalDataPoints++;
} else {
// Legacy mode: add individual values
this.data.push(value);
this.totalDataPoints++;
// Keep only the most recent data points
if (this.data.length > this.maxDataPoints) {
this.data.shift();
}
}
this.render();
this.updateInfo();