[mempool graph] show horizontal guide line

This commit is contained in:
nymkappa 2023-05-11 14:30:57 +02:00
parent 3b4dd7e633
commit 7bb34fe090
No known key found for this signature in database
GPG key ID: E155910B16E8BD04

View file

@ -181,7 +181,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
alwaysShowContent: false, alwaysShowContent: false,
position: (pos, params, el, elRect, size) => { position: (pos, params, el, elRect, size) => {
const positions = { top: (this.template === 'advanced') ? 0 : -30 }; const positions = { top: (this.template === 'advanced') ? 0 : -30 };
positions[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 60; positions[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 100;
return positions; return positions;
}, },
extraCssText: `width: ${(this.template === 'advanced') ? '275px' : '200px'}; extraCssText: `width: ${(this.template === 'advanced') ? '275px' : '200px'};
@ -189,10 +189,19 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
border: none; border: none;
box-shadow: none;`, box-shadow: none;`,
axisPointer: { axisPointer: {
type: 'line', type: 'cross',
label: {
formatter: (params: any) => {
if (params.axisDimension === 'y') {
return this.vbytesPipe.transform(params.value, 2, 'vB', 'MvB', true)
} else {
return formatterXAxis(this.locale, this.windowPreference, params.value);
}
}
}
}, },
formatter: (params: any) => { formatter: (params: any) => {
const axisValueLabel: string = formatterXAxis(this.locale, this.windowPreference, params[0].axisValue); const axisValueLabel: string = formatterXAxis(this.locale, this.windowPreference, params[0].axisValue);
const { totalValue, totalValueArray } = this.getTotalValues(params); const { totalValue, totalValueArray } = this.getTotalValues(params);
const itemFormatted = []; const itemFormatted = [];
let totalParcial = 0; let totalParcial = 0;