fix(dashboard): fix responsive grafik data
This commit is contained in:
parent
6aab9e1b71
commit
d1d0c5498a
|
|
@ -47,7 +47,6 @@ export class GraphComponent implements OnInit {
|
|||
};
|
||||
|
||||
chart: any;
|
||||
isChartLoaded = false;
|
||||
labelHourly = [
|
||||
'01.00', '02.00', '03.00', '04.00', '05.00', '06.00', '07.00', '08.00',
|
||||
'09.00', '10.00', '11.00', '12.00', '13.00', '14.00', '15.00', '16.00',
|
||||
|
|
@ -58,8 +57,8 @@ export class GraphComponent implements OnInit {
|
|||
Chart.register(LineController, LineElement, PointElement, LinearScale, Title, CategoryScale, Tooltip, Filler);
|
||||
this.selectedSensor = 'dht';
|
||||
this.parameters = this.sensorParameters[this.selectedSensor];
|
||||
|
||||
}
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
this.isLoading = true;
|
||||
setTimeout(() => {
|
||||
|
|
@ -67,10 +66,12 @@ export class GraphComponent implements OnInit {
|
|||
this.isLoading = false;
|
||||
}, 2000);
|
||||
|
||||
|
||||
console.log(this.chartElement.nativeElement);
|
||||
console.log(this.chart);
|
||||
console.log(this.isLoading);
|
||||
window.addEventListener('resize', () => {
|
||||
if (this.chart) {
|
||||
this.chart.destroy();
|
||||
this.createChart(this.dhtData.temperature, 'Temperature', '#8F5A62', this.labelHourly);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user