Merge pull request #5926 from mempool/natsoni/hashrate-graph-axis

Fix missing y axis on difficulty chart
This commit is contained in:
wiz
2025-06-02 14:56:38 -07:00
committed by GitHub

View File

@@ -364,8 +364,11 @@ export class HashrateChartComponent implements OnInit {
{
type: 'value',
position: 'right',
min: (_) => {
min: (value) => {
const firstYAxisMin = this.chartInstance.getModel().getComponent('yAxis', 0).axis.scale.getExtent()[0];
if (firstYAxisMin === Infinity) {
return value.min;
}
const selectedPowerOfTen: any = selectPowerOfTen(firstYAxisMin);
const newMin = Math.floor(firstYAxisMin / selectedPowerOfTen.divider / 10)
return 600 / 2 ** 32 * newMin * selectedPowerOfTen.divider * 10;