Merge pull request #4824 from mempool/natsoni/fix-hashrate-graph-scale
Set coherent units for hashrate and difficulty units on hashrate graph
This commit is contained in:
commit
8861aedea1
@ -339,6 +339,9 @@ export class HashrateChartComponent implements OnInit {
|
|||||||
const newMin = Math.floor(value.min / selectedPowerOfTen.divider / 10);
|
const newMin = Math.floor(value.min / selectedPowerOfTen.divider / 10);
|
||||||
return newMin * selectedPowerOfTen.divider * 10;
|
return newMin * selectedPowerOfTen.divider * 10;
|
||||||
},
|
},
|
||||||
|
max: (value) => {
|
||||||
|
return value.max;
|
||||||
|
},
|
||||||
type: 'value',
|
type: 'value',
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: 'rgb(110, 112, 121)',
|
color: 'rgb(110, 112, 121)',
|
||||||
@ -357,11 +360,18 @@ export class HashrateChartComponent implements OnInit {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
min: (value) => {
|
|
||||||
return value.min * 0.9;
|
|
||||||
},
|
|
||||||
type: 'value',
|
type: 'value',
|
||||||
position: 'right',
|
position: 'right',
|
||||||
|
min: (_) => {
|
||||||
|
const firstYAxisMin = this.chartInstance.getModel().getComponent('yAxis', 0).axis.scale.getExtent()[0];
|
||||||
|
const selectedPowerOfTen: any = selectPowerOfTen(firstYAxisMin);
|
||||||
|
const newMin = Math.floor(firstYAxisMin / selectedPowerOfTen.divider / 10)
|
||||||
|
return 600 / 2 ** 32 * newMin * selectedPowerOfTen.divider * 10;
|
||||||
|
},
|
||||||
|
max: (_) => {
|
||||||
|
const firstYAxisMax = this.chartInstance.getModel().getComponent('yAxis', 0).axis.scale.getExtent()[1];
|
||||||
|
return 600 / 2 ** 32 * firstYAxisMax;
|
||||||
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: 'rgb(110, 112, 121)',
|
color: 'rgb(110, 112, 121)',
|
||||||
formatter: (val): string => {
|
formatter: (val): string => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user