changeset 9:6edb93c20971

Fix stretching the graph limits for temperature.
author Daniel O'Connor <darius@dons.net.au>
date Tue, 03 Jan 2012 19:05:55 +1030
parents 4b9d1b47ca17
children 15fed86d9fac
files static/iwws.js
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/static/iwws.js	Sun Aug 21 15:47:52 2011 +0930
+++ b/static/iwws.js	Tue Jan 03 19:05:55 2012 +1030
@@ -48,10 +48,10 @@
     for (i = 0; i < l; i++) {
 	// Convert time from UTC to browser LT
 	t = datacache['idx'][i] - tzofs;
-	if (datacache['temp_out'] < mint)
+	if (datacache['temp_out'][i] < mint)
 	    mint = datacache['temp_out']
-	if (datacache['temp_out'] < maxt)
-	    maxt = datacache['temp_out']
+	if (datacache['temp_out'][i] > maxt)
+	    maxt = datacache['temp_out'][i]
 	temp_out.push([t * 1000.0, datacache['temp_out'][i]]);
 	if (datacache['hum_out'][i] != null && datacache['temp_out'][i] != null) {
 	    dewpt.push([t * 1000.0, hum2dp(datacache['hum_out'][i], datacache['temp_out'][i])]);
@@ -62,6 +62,7 @@
 	if (datacache['rain'][i] > 0)
 	    rain.push([t * 1000.0, datacache['rain'][i]]);
     }
+
     $.plot($("#graph1"), [
 	{ data : pressure, label: "Baro", yaxis : 1, points : { show : true }, lines : { show : true } },
 	{ data : temp_out, label: "Temp.", yaxis : 2, points : { show : true }, lines : { show : true } },