Show unit in the yaxis for hashrate chart

This commit is contained in:
nymkappa 2022-02-21 18:37:34 +09:00
parent cd626a7a8e
commit 63aecb1fd5
2 changed files with 4 additions and 3 deletions

View File

@ -116,8 +116,9 @@ export class DifficultyChartComponent implements OnInit {
type: 'value',
axisLabel: {
formatter: (val) => {
const diff = val / Math.pow(10, 12); // terra
return diff.toString() + 'T';
const selectedPowerOfTen: any = selectPowerOfTen(val);
const diff = val / selectedPowerOfTen.divider;
return `${diff} ${selectedPowerOfTen.unit}`;
}
},
splitLine: {

View File

@ -106,7 +106,7 @@ export class HashrateChartComponent implements OnInit {
formatter: (val) => {
const selectedPowerOfTen: any = selectPowerOfTen(val);
const newVal = val / selectedPowerOfTen.divider;
return `${newVal} ${selectedPowerOfTen.unit}`
return `${newVal} ${selectedPowerOfTen.unit}H/s`
}
},
splitLine: {