forked from OpenEMS/openems
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
IBRAHIM
committed
Jan 23, 2025
1 parent
79650cb
commit 0b4486c
Showing
3 changed files
with
117 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,37 @@ | ||
<oe-history-data-error [response]="errorResponse"></oe-history-data-error> | ||
<oe-history-data-error *ngIf="errorResponse" [response]="errorResponse"></oe-history-data-error> | ||
|
||
<div [style.height.px]="getChartHeight()" class="chart-container"> | ||
<ngx-spinner [name]="spinnerId" *ngIf="loading"></ngx-spinner> | ||
|
||
<div [style.height.px]="getChartHeight()"> | ||
<ngx-spinner [name]="spinnerId"></ngx-spinner> | ||
<ng-container *ngIf="!loading"> | ||
<canvas baseChart [datasets]="datasets" [labels]="labels" [options]="options" type="line"></canvas> | ||
<!-- Form to select periods --> | ||
<form (ngSubmit)="onComparePeriods()"> | ||
<div class="form-group"> | ||
<label for="period1">Période 1:</label> | ||
<select id="period1" [(ngModel)]="period1" name="period1" required> | ||
<option value="day">Jour</option> | ||
<option value="week">Semaine</option> | ||
<option value="month">Mois</option> | ||
<option value="year">Année</option> | ||
</select> | ||
<input type="date" [(ngModel)]="date1" name="date1" required> | ||
</div> | ||
<div class="form-group"> | ||
<label for="period2">Période 2:</label> | ||
<select id="period2" [(ngModel)]="period2" name="period2" required> | ||
<option value="day">Jour</option> | ||
<option value="week">Semaine</option> | ||
<option value="month">Mois</option> | ||
<option value="year">Année</option> | ||
</select> | ||
<input type="date" [(ngModel)]="date2" name="date2" required> | ||
</div> | ||
<button type="submit" [disabled]="!date1 || !date2">Compare</button> | ||
</form> | ||
|
||
<!-- Graphic--> | ||
<canvas baseChart [datasets]="datasets" [labels]="labels" [options]="options" [legend]="true" | ||
[chartType]="'bar'"> | ||
</canvas> | ||
</ng-container> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -426,4 +426,5 @@ export class Service extends AbstractService { | |
}); | ||
toast.present(); | ||
} | ||
|
||
} |