co2.php --- this reads the data from the db
Code: Select all
<?php
require_once("connection.php");
//include ("utils.php");
// (include_path='.:/opt/plesk/php/7.2/share/pear')
include_once("JSON.php");
$json = new Services_JSON();
$sqlChart_Q='SELECT mq2,unix_timestamp(timestamp) FROM example WHERE id > 57000 ORDER BY unix_timestamp(timestamp) ASC';
$sqlChart_R = mysqli_query($conn,$sqlChart_Q);
while($row = $sqlChart_R->fetch_row()) {
$time=(int)$row[1]*1000;
$mq2=(float)$row[0];
$arrChart[]=array($time, $mq2);
}
echo json_encode($arrChart);
$conn->close();
?>
But the page that draws the chart simply comes up blank. Here is its code. Please help:[[1589869534000,0],[1589880428000,735],[1589889504000,527],[1589896763000,488],[1589902200000,390],[1589905800000,399],[1589916709000,437],[1613929195000,33],[1613929195000,34],[1613929254000,35],[1613929254000,36]]
index4.php --- this is the sample code used for drawing the chart
Code: Select all
<div id="container" style="height: 400px; min-width: 310px"></div>
</body>
</html>