Fix address chart y-axis labels

This commit is contained in:
Mononaut 2024-03-21 02:49:31 +00:00
parent 19b0c4e410
commit f8a1fc6aa2
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E

View File

@ -139,14 +139,16 @@ export class AddressGraphComponent implements OnInit, OnChanges {
axisLabel: { axisLabel: {
color: 'rgb(110, 112, 121)', color: 'rgb(110, 112, 121)',
formatter: (val): string => { formatter: (val): string => {
if (maxValue > 100_000_000) { if (maxValue > 1_000_000_000) {
return `${this.amountShortenerPipe.transform(Math.round(val / 100_000_000), 0)} BTC`; return `${this.amountShortenerPipe.transform(Math.round(val / 100_000_000), 0)} BTC`;
} else if (maxValue > 100_000_000) {
return `${(val / 100_000_000).toFixed(1)} BTC`;
} else if (maxValue > 10_000_000) { } else if (maxValue > 10_000_000) {
return `${Math.round(val / 100_000_000)} BTC`;
} else if (maxValue > 100_000) {
return `${(val / 100_000_000).toFixed(2)} BTC`; return `${(val / 100_000_000).toFixed(2)} BTC`;
} else if (maxValue > 1_000_000) {
return `${(val / 100_000_000).toFixed(3)} BTC`;
} else { } else {
return `${this.amountShortenerPipe.transform(100_000_000, 0)} sats`; return `${this.amountShortenerPipe.transform(val, 0)} sats`;
} }
} }
}, },