mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-02-16 18:47:40 -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 selectedTimeSpanValue: TimeSpan = TimeSpan.Last24Hours;
|
||||||
private selectedDateValue: moment.Moment = moment().startOf('day');
|
private selectedDateValue: moment.Moment = moment().startOf('day');
|
||||||
|
|
||||||
|
private timeInterval = 5;
|
||||||
|
|
||||||
constructor(private httpClient: HttpClient) { }
|
constructor(private httpClient: HttpClient) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -87,8 +89,8 @@ export class PowerChartsComponent implements OnInit {
|
|||||||
const endString = end.toISOString();
|
const endString = end.toISOString();
|
||||||
|
|
||||||
forkJoin([
|
forkJoin([
|
||||||
this.httpClient.get<PowerStatusGrouped[]>(`/api/power/status/history-grouped?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=5`)
|
this.httpClient.get<WeatherValueGrouped[]>(`/api/weather/readings/value-history-grouped?weatherValueType=LightLevel&start=${startString}&end=${endString}&bucketMinutes=${this.timeInterval}`)
|
||||||
]).subscribe(data => {
|
]).subscribe(data => {
|
||||||
const seriesData: Array<SeriesLineOptions> = [];
|
const seriesData: Array<SeriesLineOptions> = [];
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ export class WeatherChartsComponent implements OnInit {
|
|||||||
private selectedTimeSpanValue: TimeSpan = TimeSpan.Last24Hours;
|
private selectedTimeSpanValue: TimeSpan = TimeSpan.Last24Hours;
|
||||||
private selectedDateValue: moment.Moment = moment().startOf('day');
|
private selectedDateValue: moment.Moment = moment().startOf('day');
|
||||||
|
|
||||||
|
private timeInterval = 5;
|
||||||
|
|
||||||
constructor(private httpClient: HttpClient) { }
|
constructor(private httpClient: HttpClient) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -103,7 +105,7 @@ export class WeatherChartsComponent implements OnInit {
|
|||||||
const startString = start.toISOString();
|
const startString = start.toISOString();
|
||||||
const endString = end.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 => {
|
request.subscribe(data => {
|
||||||
const seriesData: Array<SeriesLineOptions | SeriesColumnOptions> = [];
|
const seriesData: Array<SeriesLineOptions | SeriesColumnOptions> = [];
|
||||||
@@ -224,7 +226,7 @@ export class WeatherChartsComponent implements OnInit {
|
|||||||
const startString = start.toISOString();
|
const startString = start.toISOString();
|
||||||
const endString = end.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 => {
|
request.subscribe(data => {
|
||||||
const seriesData: Array<SeriesLineOptions | SeriesWindbarbOptions> = [];
|
const seriesData: Array<SeriesLineOptions | SeriesWindbarbOptions> = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user