diff --git a/frontend/src/app/components/custom-dashboard/custom-dashboard.component.ts b/frontend/src/app/components/custom-dashboard/custom-dashboard.component.ts
index b1f79fc04..fbaf7be74 100644
--- a/frontend/src/app/components/custom-dashboard/custom-dashboard.component.ts
+++ b/frontend/src/app/components/custom-dashboard/custom-dashboard.component.ts
@@ -232,8 +232,10 @@ export class CustomDashboardComponent implements OnInit, OnDestroy, AfterViewIni
this.stateService.live2Chart$
.pipe(
scan((acc, stats) => {
+ const now = Date.now() / 1000;
+ const start = now - (2 * 60 * 60);
acc.unshift(stats);
- acc = acc.slice(0, 120);
+ acc = acc.filter(p => p.added >= start);
return acc;
}, (mempoolStats || []))
),
diff --git a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts
index c456053ea..a63c166d9 100644
--- a/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts
+++ b/frontend/src/app/components/incoming-transactions-graph/incoming-transactions-graph.component.ts
@@ -66,7 +66,7 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges, On
if (!this.data) {
return;
}
- this.windowPreference = this.windowPreferenceOverride ? this.windowPreferenceOverride : this.storageService.getValue('graphWindowPreference');
+ this.windowPreference = (this.windowPreferenceOverride ? this.windowPreferenceOverride : this.storageService.getValue('graphWindowPreference')) || '2h';
const windowSize = Math.max(10, Math.floor(this.data.series[0].length / 8));
this.MA = this.calculateMA(this.data.series[0], windowSize);
if (this.outlierCappingEnabled === true) {
@@ -216,22 +216,19 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges, On
type: 'line',
},
formatter: (params: any) => {
- const axisValueLabel: string = formatterXAxis(this.locale, this.windowPreference, params[0].axisValue);
+ const bestItem = params.reduce((best, item) => {
+ return (item.seriesName === 'data' && (!best || best.value[1] < item.value[1])) ? item : best;
+ }, null);
+ const axisValueLabel: string = formatterXAxis(this.locale, this.windowPreference, bestItem.axisValue);
const colorSpan = (color: string) => ``;
let itemFormatted = '
' + axisValueLabel + '
';
- params.map((item: any, index: number) => {
-
- //Do no include MA in tooltip legend!
- if (item.seriesName !== 'MA') {
- if (index < 26) {
- itemFormatted += `
-
${colorSpan(item.color)}
+ if (bestItem) {
+ itemFormatted += `
+
${colorSpan(bestItem.color)}
-
${formatNumber(item.value[1], this.locale, '1.0-0')}vB/s
+
${formatNumber(bestItem.value[1], this.locale, '1.0-0')}vB/s
`;
- }
- }
- });
+ }
return `
${itemFormatted}
`;
}
diff --git a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts
index 4700332a3..1f1a0b739 100644
--- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts
+++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts
@@ -77,7 +77,7 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
}
this.isWidget = this.template === 'widget';
this.showCount = !this.isWidget && !this.hideCount;
- this.windowPreference = this.windowPreferenceOverride ? this.windowPreferenceOverride : this.storageService.getValue('graphWindowPreference');
+ this.windowPreference = (this.windowPreferenceOverride ? this.windowPreferenceOverride : this.storageService.getValue('graphWindowPreference')) || '2h';
this.mempoolVsizeFeesData = this.handleNewMempoolData(this.data.concat([]));
this.mountFeeChart();
}
@@ -256,11 +256,17 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
const itemFormatted = [];
let sum = 0;
let progressPercentageText = '';
- let countItem;
- let items = this.inverted ? [...params].reverse() : params;
- if (items[items.length - 1].seriesName === 'count') {
- countItem = items.pop();
- }
+ const unfilteredItems = this.inverted ? [...params].reverse() : params;
+ const countItem = unfilteredItems.find(p => p.seriesName === 'count');
+ const usedSeries = {};
+ const items = unfilteredItems.filter(p => {
+ if (usedSeries[p.seriesName] || p.seriesName === 'count') {
+ return false;
+ }
+ usedSeries[p.seriesName] = true;
+ return true;
+ });
+
items.map((item: any, index: number) => {
sum += item.value[1];
const progressPercentage = (item.value[1] / totalValue) * 100;
diff --git a/frontend/src/app/components/television/television.component.ts b/frontend/src/app/components/television/television.component.ts
index 3ac8ef648..40f4b7192 100644
--- a/frontend/src/app/components/television/television.component.ts
+++ b/frontend/src/app/components/television/television.component.ts
@@ -71,7 +71,9 @@ export class TelevisionComponent implements OnInit, OnDestroy {
mempoolStats = newStats;
} else if (['2h', '24h'].includes(this.fragment)) {
mempoolStats.unshift(newStats[0]);
- mempoolStats = mempoolStats.slice(0, mempoolStats.length - 1);
+ const now = Date.now() / 1000;
+ const start = now - (this.fragment === '2h' ? (2 * 60 * 60) : (24 * 60 * 60) );
+ mempoolStats = mempoolStats.filter(p => p.added >= start);
}
return mempoolStats;
})
diff --git a/frontend/src/app/dashboard/dashboard.component.ts b/frontend/src/app/dashboard/dashboard.component.ts
index 1660e7310..6bedaafb0 100644
--- a/frontend/src/app/dashboard/dashboard.component.ts
+++ b/frontend/src/app/dashboard/dashboard.component.ts
@@ -231,8 +231,10 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewInit {
this.stateService.live2Chart$
.pipe(
scan((acc, stats) => {
+ const now = Date.now() / 1000;
+ const start = now - (2 * 60 * 60);
acc.unshift(stats);
- acc = acc.slice(0, 120);
+ acc = acc.filter(p => p.added >= start);
return acc;
}, (mempoolStats || []))
),