" . mysqli_error($mysql) . "
"; } //$obj[] = (object)[]; // Cast empty array to object while ($row = $result->fetch_assoc()) { $ii = 1; $anno = (object)[]; if($row["sunrise"] < (time()+$_GET["FROM"]*60*60)){ $anno->xMin = (time()+$_GET["FROM"]*60*60)*1000; }else{ $anno->xMin = $row["sunrise"]*1000; } if($row["sunset"] > (time()+$_GET["TO"]*60*60)){ $anno->xMax = round(time()+$_GET["TO"]*60*60)*1000; }else{ $anno->xMax = $row["sunset"]*1000; } $anno->borderWidth = 0; if($row["sunset"] > (time()+$_GET["FROM"]*60*60)){ $obj[] = clone $anno; } } } //header('Content-Type: application/json'); echo json_encode($obj); //echo '{"labels":[1761322682000,1761322782000,1761322882000,1761322982000,1761323082000,1761323182000,1761323282000],"datasets":[{"stack": "Stack 0","cubicInterpolationMode":"monotone","fill":"origin","label":"Acquisitions by year","data":[10,20,50,20,10,5,70]},{"fill": "false","stack": "Stack 1","cubicInterpolationMode": "monotone","label": "Acquisitions by year","data": [10,20,50,20,10,5,70]}]}';