[graph] don't change yaxis scale if no outliers - save state in localstorage
This commit is contained in:
parent
2d30c0b588
commit
dc26c6f105
@ -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,
|
||||
|
@ -117,7 +117,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input style="margin-top: 9px" class="form-check-input" type="checkbox" value="" id="hide-outliers" (change)="onOutlierToggleChange($event)">
|
||||
<input style="margin-top: 9px" class="form-check-input" type="checkbox" [checked]="outlierCappingEnabled" id="hide-outliers" (change)="onOutlierToggleChange($event)">
|
||||
<label class="form-check-label" for="hide-outliers">
|
||||
<small i18n="statistics.cap-outliers">Cap outliers</small>
|
||||
</label>
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user