Add inverted chart feature.

This commit is contained in:
Miguel Medeiros
2021-09-26 11:41:55 -03:00
parent 7ab1ce8fc4
commit 5ce7b55441
3 changed files with 40 additions and 28 deletions

View File

@@ -31,6 +31,7 @@ export class StatisticsComponent implements OnInit {
radioGroupForm: FormGroup;
graphWindowPreference: String;
inverted: boolean;
constructor(
@Inject(LOCALE_ID) private locale: string,
@@ -44,6 +45,7 @@ export class StatisticsComponent implements OnInit {
) { }
ngOnInit() {
this.inverted = this.storageService.getValue('inverted-graph') === 'true';
this.seoService.setTitle($localize`:@@5d4f792f048fcaa6df5948575d7cb325c9393383:Graphs`);
this.stateService.networkChanged$.subscribe((network) => this.network = network);
this.graphWindowPreference = this.storageService.getValue('graphWindowPreference') ? this.storageService.getValue('graphWindowPreference').trim() : '2h';
@@ -124,4 +126,9 @@ export class StatisticsComponent implements OnInit {
saveGraphPreference() {
this.storageService.setValue('graphWindowPreference', this.radioGroupForm.controls.dateSpan.value);
}
invertGraph() {
this.storageService.setValue('inverted-graph', !this.inverted);
document.location.reload();
}
}