diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-08-08 10:26:26 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-08-08 10:26:26 +0000 |
| commit | a36f295bd55b49054c3b0c1e340c471bea98c055 (patch) | |
| tree | c78076d3e8a97b6b1a8e5dc0d8e4195c8d25fa43 /frontends/php/include/classes/pie.inc.php | |
| parent | a489ced3012a4f07f928f2a11d904b55e8b96464 (diff) | |
| download | zabbix-a36f295bd55b49054c3b0c1e340c471bea98c055.tar.gz zabbix-a36f295bd55b49054c3b0c1e340c471bea98c055.tar.xz zabbix-a36f295bd55b49054c3b0c1e340c471bea98c055.zip | |
- fixes to SQL statements for pgSQL (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@4522 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/classes/pie.inc.php')
| -rw-r--r-- | frontends/php/include/classes/pie.inc.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/frontends/php/include/classes/pie.inc.php b/frontends/php/include/classes/pie.inc.php index da2a71d4..c33149e8 100644 --- a/frontends/php/include/classes/pie.inc.php +++ b/frontends/php/include/classes/pie.inc.php @@ -98,7 +98,7 @@ function selectData(){ if(($this->period / $this->sizeX) <= (ZBX_MAX_TREND_DIFF / ZBX_GRAPH_MAX_SKIP_CELL)){ array_push($sql_arr, - 'SELECT h.itemid, i.lastvalue as lst, '. + 'SELECT h.itemid, max(i.lastvalue) as lst, '. ' avg(h.value) AS avg,min(h.value) AS min, '. ' max(h.value) AS max,max(h.clock) AS clock '. ' FROM history AS h LEFT JOIN items AS i ON h.itemid = i.itemid'. @@ -108,7 +108,7 @@ function selectData(){ ' GROUP BY h.itemid' , - 'SELECT hu.itemid, i.lastvalue as lst, '. + 'SELECT hu.itemid, max(i.lastvalue) as lst, '. ' avg(hu.value) AS avg,min(hu.value) AS min,'. ' max(hu.value) AS max,max(hu.clock) AS clock'. ' FROM history_uint AS hu LEFT JOIN items AS i ON hu.itemid = i.itemid'. @@ -120,7 +120,7 @@ function selectData(){ } else{ array_push($sql_arr, - 'SELECT t.itemid, i.lastvalue as lst, '. + 'SELECT t.itemid, max(i.lastvalue) as lst, '. ' avg(t.value_avg) AS avg,min(t.value_min) AS min,'. ' max(t.value_max) AS max,max(t.clock) AS clock'. ' FROM trends AS t LEFT JOIN items AS i ON t.itemid = i.itemid'. @@ -384,9 +384,10 @@ function drawElementPie($values){ $anglestart = 0; $angleend = 0; foreach($values as $item => $value){ - $angleend += (int)(360 * $value/$sum)+1; + $angleend += (int)(360 * $value/$sum); $angleend = ($angleend > 360)?(360):($angleend); if(($angleend - $anglestart) < 1) continue; + $angleend++; if($this->type == GRAPH_TYPE_EXPLODED){ list($x,$y) = $this->calcExplodedCenter($anglestart,$angleend,$xc,$yc,count($values)); @@ -439,9 +440,10 @@ function drawElementPie3D($values){ $angleend = 0; foreach($values as $item => $value){ - $angleend += (int)(360 * $value/$sum) +1; + $angleend += (int)(360 * $value/$sum); $angleend = ($angleend > 360)?(360):($angleend); if(($angleend - $anglestart) < 1) continue; + $angleend++; if($this->type == GRAPH_TYPE_3D_EXPLODED){ list($x,$y) = $this->calcExplodedCenter($anglestart,$angleend,$xc,$yc,count($values)); @@ -456,11 +458,12 @@ function drawElementPie3D($values){ $anglestart = 0; $angleend = 0; foreach($values as $item => $value){ - $angleend += (int)(360 * $value/$sum) +1; + $angleend += (int)(360 * $value/$sum); $angleend = ($angleend > 360)?(360):($angleend); if(($angleend - $anglestart) < 1) continue; elseif($this->sum == 0) continue; + $angleend++; if($this->type == GRAPH_TYPE_3D_EXPLODED){ list($x,$y) = $this->calcExplodedCenter($anglestart,$angleend,$xc,$yc,count($values)); @@ -600,4 +603,4 @@ function Draw(){ } } -?>
\ No newline at end of file +?> |
