Mit Diagramm für 1 Tag

This commit is contained in:
Tobias Peper 2025-03-26 22:18:13 +01:00
parent 4900d71722
commit 5cffc1d09f
4 changed files with 56 additions and 83 deletions

View File

@ -1,5 +1,5 @@
<main class="main"> <main class="main">
<div style="border: 1px solid blueviolet;width: 640px; height: 320px;"> <div style="border: 1px solid blueviolet;width: 100%; height: 100%;">
<canvas id="canvas"></canvas> <canvas id="canvas"></canvas>
</div> </div>
<div ngbAccordion> <div ngbAccordion>

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { Statistics } from './statistics'; import { Statistics } from './statistics';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { Aggregate } from './aggregate';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@ -12,10 +13,13 @@ export class RestService {
} }
getStatistics(): Observable<Statistics> { getStatistics(): Observable<Statistics> {
return this.http.get<Statistics>('https://vz.home.peper.info/rest-vz/stats?houseId=1&duration=P7D'); return this.http.get<Statistics>('https://vz.home.peper.info/rest-vz/stats?houseId=1&duration=P7D');
} }
getLatestData(): Observable<Aggregate[]> {
return this.http.get<Aggregate[]>('https://vz.home.peper.info/rest-vz/latest-data?houseId=1&timeWindow=1440');
}
getStatisticsWithDuration(duration: string | undefined): Observable<Statistics> { getStatisticsWithDuration(duration: string | undefined): Observable<Statistics> {
if (duration) { if (duration) {
return this.http.get<Statistics>('https://vz.home.peper.info/rest-vz/stats?houseId=1&duration=' + duration); return this.http.get<Statistics>('https://vz.home.peper.info/rest-vz/stats?houseId=1&duration=' + duration);

View File

@ -4,7 +4,6 @@ import { RestService } from '../rest.service';
import { formatDate, formatNumber } from '@angular/common'; import { formatDate, formatNumber } from '@angular/common';
import { NgIf } from '@angular/common'; import { NgIf } from '@angular/common';
import * as _ from 'lodash'; import * as _ from 'lodash';
//import { RestService } from '../rest.service';
@Component({ @Component({
selector: 'app-test', selector: 'app-test',