Show unit in the yaxis for hashrate chart

This commit is contained in:
nymkappa 2022-02-21 18:37:34 +09:00
parent beeda5fa87
commit b2f872c4cc
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04
2 changed files with 4 additions and 3 deletions

View File

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

View File

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