mirror of
https://github.com/mempool/mempool.git
synced 2025-09-28 23:03:57 +02:00
Merge pull request #5926 from mempool/natsoni/hashrate-graph-axis
Fix missing y axis on difficulty chart
This commit is contained in:
@@ -364,8 +364,11 @@ export class HashrateChartComponent implements OnInit {
|
|||||||
{
|
{
|
||||||
type: 'value',
|
type: 'value',
|
||||||
position: 'right',
|
position: 'right',
|
||||||
min: (_) => {
|
min: (value) => {
|
||||||
const firstYAxisMin = this.chartInstance.getModel().getComponent('yAxis', 0).axis.scale.getExtent()[0];
|
const firstYAxisMin = this.chartInstance.getModel().getComponent('yAxis', 0).axis.scale.getExtent()[0];
|
||||||
|
if (firstYAxisMin === Infinity) {
|
||||||
|
return value.min;
|
||||||
|
}
|
||||||
const selectedPowerOfTen: any = selectPowerOfTen(firstYAxisMin);
|
const selectedPowerOfTen: any = selectPowerOfTen(firstYAxisMin);
|
||||||
const newMin = Math.floor(firstYAxisMin / selectedPowerOfTen.divider / 10)
|
const newMin = Math.floor(firstYAxisMin / selectedPowerOfTen.divider / 10)
|
||||||
return 600 / 2 ** 32 * newMin * selectedPowerOfTen.divider * 10;
|
return 600 / 2 ** 32 * newMin * selectedPowerOfTen.divider * 10;
|
||||||
|
Reference in New Issue
Block a user