Add more precision to hashrate graphs

This commit is contained in:
ncois
2023-12-04 09:56:56 +01:00
parent 0a70273456
commit c216e849e6
3 changed files with 13 additions and 13 deletions

View File

@@ -249,8 +249,8 @@ export class HashrateChartComponent implements OnInit {
for (const tick of ticks) {
if (tick.seriesIndex === 0) { // Hashrate
let hashrate = tick.data[1];
hashratePowerOfTen = selectPowerOfTen(tick.data[1]);
hashrate = Math.round(tick.data[1] / hashratePowerOfTen.divider);
hashratePowerOfTen = selectPowerOfTen(tick.data[1], 10);
hashrate = tick.data[1] / hashratePowerOfTen.divider;
hashrateString = `${tick.marker} ${tick.seriesName}: ${formatNumber(hashrate, this.locale, '1.0-0')} ${hashratePowerOfTen.unit}H/s<br>`;
} else if (tick.seriesIndex === 1) { // Difficulty
let difficultyPowerOfTen = hashratePowerOfTen;
@@ -264,8 +264,8 @@ export class HashrateChartComponent implements OnInit {
}
} else if (tick.seriesIndex === 2) { // Hashrate MA
let hashrate = tick.data[1];
hashratePowerOfTen = selectPowerOfTen(tick.data[1]);
hashrate = Math.round(tick.data[1] / hashratePowerOfTen.divider);
hashratePowerOfTen = selectPowerOfTen(tick.data[1], 10);
hashrate = tick.data[1] / hashratePowerOfTen.divider;
hashrateStringMA = `${tick.marker} ${tick.seriesName}: ${formatNumber(hashrate, this.locale, '1.0-0')} ${hashratePowerOfTen.unit}H/s`;
}
}

View File

@@ -163,8 +163,8 @@ export class PoolComponent implements OnInit {
let hashratePowerOfTen: any = selectPowerOfTen(1);
let hashrate = ticks[0].data[1];
hashratePowerOfTen = selectPowerOfTen(ticks[0].data[1]);
hashrate = Math.round(ticks[0].data[1] / hashratePowerOfTen.divider);
hashratePowerOfTen = selectPowerOfTen(ticks[0].data[1], 10);
hashrate = ticks[0].data[1] / hashratePowerOfTen.divider;
return `
<b style="color: white; margin-left: 18px">${ticks[0].axisValueLabel}</b><br>