[Phphtmllib-devel] SF.net SVN: phphtmllib:[3220] trunk/open2300/lib/modules/graphs/ RainLineGraph.i
Status: Beta
Brought to you by:
hemna
From: <he...@us...> - 2009-02-22 17:19:36
|
Revision: 3220 http://phphtmllib.svn.sourceforge.net/phphtmllib/?rev=3220&view=rev Author: hemna Date: 2009-02-22 17:19:26 +0000 (Sun, 22 Feb 2009) Log Message: ----------- make the daily rain graph have totals for today only Modified Paths: -------------- trunk/open2300/lib/modules/graphs/RainLineGraph.inc Modified: trunk/open2300/lib/modules/graphs/RainLineGraph.inc =================================================================== --- trunk/open2300/lib/modules/graphs/RainLineGraph.inc 2009-02-17 15:15:59 UTC (rev 3219) +++ trunk/open2300/lib/modules/graphs/RainLineGraph.inc 2009-02-22 17:19:26 UTC (rev 3220) @@ -35,11 +35,15 @@ $today = date("Y-m-d"); $collection = weatherDataObject::find_all("datetime like :date order by datetime asc", array(':date'=> $today.'%')); + $offset = 0; foreach($collection as $wx) { /** * @param $wx weatherDataObject */ - $this->graph_data[] = $wx->get_rain_total(); + if ($offset == 0) { + $offset = $wx->get_rain_total(); + } + $this->graph_data[] = $wx->get_rain_total() - $offset; $this->time_data[] = strtotime($wx->get_datetime()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |