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 82e3e77e7..f6d2de5df 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 @@ -255,7 +255,15 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges, On } ], yAxis: { - max: this.outlierCappingEnabled ? Math.round(this.medianVbytesPerSecond * OUTLIERS_MEDIAN_MULTIPLIER) : undefined, + max: (value) => { + if (!this.outlierCappingEnabled) { + return undefined; + } + if (value.max < this.medianVbytesPerSecond * OUTLIERS_MEDIAN_MULTIPLIER) { + return undefined; + } + return Math.round(this.medianVbytesPerSecond * OUTLIERS_MEDIAN_MULTIPLIER); + }, type: 'value', axisLabel: { fontSize: 11, diff --git a/frontend/src/app/components/statistics/statistics.component.html b/frontend/src/app/components/statistics/statistics.component.html index c726e354e..0bb10a1c3 100644 --- a/frontend/src/app/components/statistics/statistics.component.html +++ b/frontend/src/app/components/statistics/statistics.component.html @@ -117,7 +117,7 @@
- + diff --git a/frontend/src/app/components/statistics/statistics.component.ts b/frontend/src/app/components/statistics/statistics.component.ts index 8e01e068b..fdd5a018e 100644 --- a/frontend/src/app/components/statistics/statistics.component.ts +++ b/frontend/src/app/components/statistics/statistics.component.ts @@ -67,6 +67,7 @@ export class StatisticsComponent implements OnInit { this.seoService.setDescription($localize`:@@meta.description.bitcoin.graphs.mempool:See mempool size (in MvB) and transactions per second (in vB/s) visualized over time.`); this.stateService.networkChanged$.subscribe((network) => this.network = network); this.graphWindowPreference = this.storageService.getValue('graphWindowPreference') ? this.storageService.getValue('graphWindowPreference').trim() : '2h'; + this.outlierCappingEnabled = this.storageService.getValue('cap-outliers') === 'true'; this.radioGroupForm = this.formBuilder.group({ dateSpan: this.graphWindowPreference @@ -212,6 +213,7 @@ export class StatisticsComponent implements OnInit { onOutlierToggleChange(e): void { this.outlierCappingEnabled = e.target.checked; + this.storageService.setValue('cap-outliers', e.target.checked); } onSaveChart(name) {