Change adValue for always summing up values received
This commit is contained in:
@@ -63,21 +63,11 @@ class ASCIIBarChart {
|
|||||||
* @param {number} value - The numeric value to add
|
* @param {number} value - The numeric value to add
|
||||||
*/
|
*/
|
||||||
addValue(value) {
|
addValue(value) {
|
||||||
if (this.useBinMode) {
|
|
||||||
// Time bin mode: increment count in current active bin
|
// Time bin mode: increment count in current active bin
|
||||||
this.checkBinRotation(); // Ensure we have an active bin
|
this.checkBinRotation(); // Ensure we have an active bin
|
||||||
this.bins[this.currentBinIndex].count++;
|
this.bins[this.currentBinIndex].count++;
|
||||||
this.totalDataPoints++;
|
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.render();
|
||||||
this.updateInfo();
|
this.updateInfo();
|
||||||
|
|||||||
Reference in New Issue
Block a user