Mercurial > ~darius > hgwebdir.cgi > iwws
comparison static/iwws.js @ 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 | bfe6ed563ffc |
comparison
equal
deleted
inserted
replaced
8:4b9d1b47ca17 | 9:6edb93c20971 |
---|---|
46 var d = new Date(); | 46 var d = new Date(); |
47 var tzofs = d.getTimezoneOffset() * 60; | 47 var tzofs = d.getTimezoneOffset() * 60; |
48 for (i = 0; i < l; i++) { | 48 for (i = 0; i < l; i++) { |
49 // Convert time from UTC to browser LT | 49 // Convert time from UTC to browser LT |
50 t = datacache['idx'][i] - tzofs; | 50 t = datacache['idx'][i] - tzofs; |
51 if (datacache['temp_out'] < mint) | 51 if (datacache['temp_out'][i] < mint) |
52 mint = datacache['temp_out'] | 52 mint = datacache['temp_out'] |
53 if (datacache['temp_out'] < maxt) | 53 if (datacache['temp_out'][i] > maxt) |
54 maxt = datacache['temp_out'] | 54 maxt = datacache['temp_out'][i] |
55 temp_out.push([t * 1000.0, datacache['temp_out'][i]]); | 55 temp_out.push([t * 1000.0, datacache['temp_out'][i]]); |
56 if (datacache['hum_out'][i] != null && datacache['temp_out'][i] != null) { | 56 if (datacache['hum_out'][i] != null && datacache['temp_out'][i] != null) { |
57 dewpt.push([t * 1000.0, hum2dp(datacache['hum_out'][i], datacache['temp_out'][i])]); | 57 dewpt.push([t * 1000.0, hum2dp(datacache['hum_out'][i], datacache['temp_out'][i])]); |
58 } | 58 } |
59 wavg.push([t * 1000.0, datacache['wind_ave'][i], wind2angle(datacache['wind_dir'][i])]); | 59 wavg.push([t * 1000.0, datacache['wind_ave'][i], wind2angle(datacache['wind_dir'][i])]); |
60 wgust.push([t * 1000.0, datacache['wind_gust'][i], wind2angle(datacache['wind_dir'][i])]); | 60 wgust.push([t * 1000.0, datacache['wind_gust'][i], wind2angle(datacache['wind_dir'][i])]); |
61 pressure.push([t * 1000.0, datacache['abs_pressure'][i]]); | 61 pressure.push([t * 1000.0, datacache['abs_pressure'][i]]); |
62 if (datacache['rain'][i] > 0) | 62 if (datacache['rain'][i] > 0) |
63 rain.push([t * 1000.0, datacache['rain'][i]]); | 63 rain.push([t * 1000.0, datacache['rain'][i]]); |
64 } | 64 } |
65 | |
65 $.plot($("#graph1"), [ | 66 $.plot($("#graph1"), [ |
66 { data : pressure, label: "Baro", yaxis : 1, points : { show : true }, lines : { show : true } }, | 67 { data : pressure, label: "Baro", yaxis : 1, points : { show : true }, lines : { show : true } }, |
67 { data : temp_out, label: "Temp.", yaxis : 2, points : { show : true }, lines : { show : true } }, | 68 { data : temp_out, label: "Temp.", yaxis : 2, points : { show : true }, lines : { show : true } }, |
68 { data : dewpt, label: "Dew point", yaxis : 2, points : { show : true }, lines : { show : true } }, | 69 { data : dewpt, label: "Dew point", yaxis : 2, points : { show : true }, lines : { show : true } }, |
69 ], | 70 ], |