Merge pull request #5876 from mempool/natsoni/fix-hashrate-chart-overflow

Fix cropped difficulty series in hashrate chart
This commit is contained in:
nymkappa 2025-04-16 11:40:18 +09:00 committed by GitHub
commit f218ff26ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -370,9 +370,10 @@ export class HashrateChartComponent implements OnInit {
const newMin = Math.floor(firstYAxisMin / selectedPowerOfTen.divider / 10)
return 600 / 2 ** 32 * newMin * selectedPowerOfTen.divider * 10;
},
max: (_) => {
max: (value) => {
const firstYAxisMax = this.chartInstance.getModel().getComponent('yAxis', 0).axis.scale.getExtent()[1];
return 600 / 2 ** 32 * firstYAxisMax;
const scaledMax = 600 / 2 ** 32 * firstYAxisMax;
return Math.max(scaledMax, value.max);
},
axisLabel: {
color: 'rgb(110, 112, 121)',