add graph info

This commit is contained in:
Simon Vieille 2020-03-22 19:14:34 +01:00
parent e6a88c4d99
commit ba8ad57a3c
Signed by: deblan
GPG key ID: 03383D15A1D31745

View file

@ -37,9 +37,15 @@ class MonitoringApiController extends AbstractController
];
foreach ($entities as $entity) {
$hour = (int) $entity->getDate()->format('H');
$labels[] = $entity->getDate()->format('H:i');
$line['data'][] = $entity->getValue();
$line2['data'][] = 27;
if ($hour >= 20 || $hour <= 10) {
$line2['data'][] = 23;
} else {
$line2['data'][] = 27;
}
}
$datasets[] = $line;