From b2f872c4cc2947c85d124e9cdf02bf0ace1b261d Mon Sep 17 00:00:00 2001 From: nymkappa Date: Mon, 21 Feb 2022 18:37:34 +0900 Subject: [PATCH] Show unit in the yaxis for hashrate chart --- .../difficulty-chart/difficulty-chart.component.ts | 5 +++-- .../components/hashrate-chart/hashrate-chart.component.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/components/difficulty-chart/difficulty-chart.component.ts b/frontend/src/app/components/difficulty-chart/difficulty-chart.component.ts index 6ce15599c..d9056633d 100644 --- a/frontend/src/app/components/difficulty-chart/difficulty-chart.component.ts +++ b/frontend/src/app/components/difficulty-chart/difficulty-chart.component.ts @@ -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: { diff --git a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts index 0f5a6a98e..3e3e353fe 100644 --- a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts +++ b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts @@ -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: {