dev smartfarming #1

Merged
agrilink merged 53 commits from development into main 2024-12-30 05:53:19 +00:00
2 changed files with 16 additions and 2 deletions
Showing only changes of commit e478095235 - Show all commits

View File

@ -6,8 +6,8 @@
}
canvas {
width: max-content;
height: 80%!important;
width: 100%;
height: 30vh;
margin: 20px;
align-items: center;
}

View File

@ -57,6 +57,14 @@ export class GraphComponent implements OnInit {
this.selectedSensor = 'dht';
this.parameters = this.sensorParameters[this.selectedSensor];
this.createChart(this.dhtData.temperature, 'Temperature', '#8F5A62', this.labelHourly);
window.addEventListener('resize', () => {
if (this.chart) {
this.chart.destroy();
this.createChart(this.dhtData.temperature, 'Temperature', '#8F5A62', this.labelHourly);
}
});
}
createChart(data: number[], label: string, borderColor: string, labels: string[]): void {
@ -131,9 +139,15 @@ export class GraphComponent implements OnInit {
},
scales: {
x: {
grid:{
display: false
},
beginAtZero: true
},
y: {
grid:{
display: false
},
beginAtZero: true
}
}