mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-13 17:22:54 -05:00
Adjust chart time intervals
This commit is contained in:
@@ -35,6 +35,8 @@ export class PowerChartsComponent implements OnInit {
|
||||
private selectedTimeSpanValue: TimeSpan = TimeSpan.Last24Hours;
|
||||
private selectedDateValue: moment.Moment = moment().startOf('day');
|
||||
|
||||
private timeInterval = 5;
|
||||
|
||||
constructor(private httpClient: HttpClient) { }
|
||||
|
||||
ngOnInit() {
|
||||
@@ -87,8 +89,8 @@ export class PowerChartsComponent implements OnInit {
|
||||
const endString = end.toISOString();
|
||||
|
||||
forkJoin([
|
||||
this.httpClient.get<PowerStatusGrouped[]>(`/api/power/status/history-grouped?start=${startString}&end=${endString}&bucketMinutes=5`),
|
||||
this.httpClient.get<WeatherValueGrouped[]>(`/api/weather/readings/value-history-grouped?weatherValueType=LightLevel&start=${startString}&end=${endString}&bucketMinutes=5`)
|
||||
this.httpClient.get<PowerStatusGrouped[]>(`/api/power/status/history-grouped?start=${startString}&end=${endString}&bucketMinutes=${this.timeInterval}`),
|
||||
this.httpClient.get<WeatherValueGrouped[]>(`/api/weather/readings/value-history-grouped?weatherValueType=LightLevel&start=${startString}&end=${endString}&bucketMinutes=${this.timeInterval}`)
|
||||
]).subscribe(data => {
|
||||
const seriesData: Array<SeriesLineOptions> = [];
|
||||
|
||||
|
||||
@@ -42,6 +42,8 @@ export class WeatherChartsComponent implements OnInit {
|
||||
private selectedTimeSpanValue: TimeSpan = TimeSpan.Last24Hours;
|
||||
private selectedDateValue: moment.Moment = moment().startOf('day');
|
||||
|
||||
private timeInterval = 5;
|
||||
|
||||
constructor(private httpClient: HttpClient) { }
|
||||
|
||||
ngOnInit() {
|
||||
@@ -103,7 +105,7 @@ export class WeatherChartsComponent implements OnInit {
|
||||
const startString = start.toISOString();
|
||||
const endString = end.toISOString();
|
||||
|
||||
const request = this.httpClient.get<WeatherReadingGrouped[]>(`/api/weather/readings/history-grouped?start=${startString}&end=${endString}&bucketMinutes=30`);
|
||||
const request = this.httpClient.get<WeatherReadingGrouped[]>(`/api/weather/readings/history-grouped?start=${startString}&end=${endString}&bucketMinutes=${this.timeInterval}`);
|
||||
|
||||
request.subscribe(data => {
|
||||
const seriesData: Array<SeriesLineOptions | SeriesColumnOptions> = [];
|
||||
@@ -224,7 +226,7 @@ export class WeatherChartsComponent implements OnInit {
|
||||
const startString = start.toISOString();
|
||||
const endString = end.toISOString();
|
||||
|
||||
const request = this.httpClient.get<WindHistoryGrouped[]>(`/api/weather/readings/wind-history-grouped?start=${startString}&end=${endString}&bucketMinutes=30`);
|
||||
const request = this.httpClient.get<WindHistoryGrouped[]>(`/api/weather/readings/wind-history-grouped?start=${startString}&end=${endString}&bucketMinutes=${this.timeInterval}`);
|
||||
|
||||
request.subscribe(data => {
|
||||
const seriesData: Array<SeriesLineOptions | SeriesWindbarbOptions> = [];
|
||||
|
||||
Reference in New Issue
Block a user