Skip to content

Commit

Permalink
Auto update of graphs every 90s
Browse files Browse the repository at this point in the history
  • Loading branch information
evilbunny2008 committed Jan 28, 2024
1 parent fbd82e5 commit bbefd07
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
12 changes: 6 additions & 6 deletions data.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
$ac = "on";

if($ac == "on")
$dataPoints1[] = array('x' => intval($row['whentime']), 'y' => intval($row['temperature']), 'inindexLabel' => $ac, 'markerType' => 'cross', 'markerSize' => 20,'markerColor' => '#4F81BC');
$dataPoints1[] = array('x' => intval($row['whentime']), 'y' => floatval($row['temperature']), 'inindexLabel' => $ac, 'markerType' => 'cross', 'markerSize' => 20,'markerColor' => 'green');
else
$dataPoints1[] = array('x' => intval($row['whentime']), 'y' => intval($row['temperature']), 'inindexLabel' => $ac, 'markerType' => 'cross', 'markerSize' => 20,'markerColor' => 'tomato');
$dataPoints1[] = array('x' => intval($row['whentime']), 'y' => floatval($row['temperature']), 'inindexLabel' => $ac, 'markerType' => 'cross', 'markerSize' => 20,'markerColor' => 'tomato');
} else {
$dataPoints1[] = array('x' => intval($row['whentime']), 'y' => intval($row['temperature']));
$dataPoints1[] = array('x' => intval($row['whentime']), 'y' => floatval($row['temperature']));
$airconon = $row['airconon'];
}

$dataPoints2[] = array('x' => intval($row['whentime']), 'y' => intval($row['humidity']));
$dataPoints3[] = array('x' => intval($row['whentime']), 'y' => intval($row['feelslike']));
$dataPoints4[] = array('x' => intval($row['whentime']), 'y' => intval($row['rssi']));
$dataPoints2[] = array('x' => intval($row['whentime']), 'y' => floatval($row['humidity']));
$dataPoints3[] = array('x' => intval($row['whentime']), 'y' => floatval($row['feelslike']));
$dataPoints4[] = array('x' => intval($row['whentime']), 'y' => floatval($row['rssi']));

$currtemp = $row['temperature'];
$currhumid = $row['humidity'];
Expand Down
24 changes: 6 additions & 18 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@
var entry = e.entries[i];
if(entry.dataSeries.name == "Temperature [°C]")
content += "<div style='color:#4F81BC'>" + entry.dataSeries.name + ": " + entry.dataPoint.y + "°C</div>";
content += "<div style='color:#9BBB58'>" + entry.dataSeries.name + ": " + entry.dataPoint.y + "°C</div>";
else if(entry.dataSeries.name == "Humidity [%]")
content += "<div style='color:#C0504E'>" + entry.dataSeries.name + ": " + entry.dataPoint.y + "%</div>";
else if(entry.dataSeries.name == "Feels Like [°C]")
content += "<div style='color:#9BBB58'>" + entry.dataSeries.name + ": " + entry.dataPoint.y + "°C</div>";
content += "<div style='color:#4F81BC'>" + entry.dataSeries.name + ": " + entry.dataPoint.y + "°C</div>";
if(entry.dataPoint.markerType == 'cross')
content += "<br/><div>Aircon was turned " + entry.dataPoint.inindexLabel + "</div>";
Expand All @@ -104,10 +104,10 @@
axisY:
{
title: "Temperature [°C]",
titleFontColor: "#4F81BC",
lineColor: "#4F81BC",
labelFontColor: "#4F81BC",
tickColor: "#4F81BC"
titleFontColor: "#9BBB58",
lineColor: "#9BBB58",
labelFontColor: "#9BBB58",
tickColor: "#9BBB58"
},
axisY2:
{
Expand All @@ -131,31 +131,19 @@
xValueType: "dateTime",
markerSize: 0,
showInLegend: true,
titleFontColor: "#9BBB58",
lineColor: "#9BBB58",
labelFontColor: "#9BBB58",
tickColor: "#9BBB58"
},{
type: "line",
axisYType: "secondary",
name: "Humidity [%]",
xValueType: "dateTime",
markerSize: 0,
showInLegend: true,
titleFontColor: "#C0504E",
lineColor: "#C0504E",
labelFontColor: "#C0504E",
tickColor: "#C0504E"
},{
type: "line",
name: "Temperature [°C]",
xValueType: "dateTime",
markerSize: 0,
showInLegend: true,
titleFontColor: "#4F81BC",
lineColor: "#4F81BC",
labelFontColor: "#4F81BC",
tickColor: "#4F81BC"
}
]
});
Expand Down

0 comments on commit bbefd07

Please sign in to comment.