diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-08-28 10:29:30 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-08-28 10:29:30 +0000 |
| commit | 971a6233f5b5c95361fff6fc9ee671de5958bd1e (patch) | |
| tree | 6d3a621ef3ac821b55cf9a69433a90ce1e4bf8ca /frontends/php/include/classes/graph.inc.php | |
| parent | 7c46c407403c42d02d92498787151d178dd61d3e (diff) | |
| download | zabbix-971a6233f5b5c95361fff6fc9ee671de5958bd1e.tar.gz zabbix-971a6233f5b5c95361fff6fc9ee671de5958bd1e.tar.xz zabbix-971a6233f5b5c95361fff6fc9ee671de5958bd1e.zip | |
- fixed graph item ordering and some bugs of graph drawing (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3215 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/classes/graph.inc.php')
| -rw-r--r-- | frontends/php/include/classes/graph.inc.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/frontends/php/include/classes/graph.inc.php b/frontends/php/include/classes/graph.inc.php index e42a0d81..abd56005 100644 --- a/frontends/php/include/classes/graph.inc.php +++ b/frontends/php/include/classes/graph.inc.php @@ -1049,17 +1049,17 @@ /* calculte shift for stacked graphs */ if($this->type == GRAPH_TYPE_STACKED /* stacked graph */) { - for($i=$this->num-2; $i >= 0; $i--) + for($i=1; $i<$this->num; $i++) { $curr_data = &$this->data[$this->items[$i]["itemid"]][$this->items[$i]["type"]]; if(!isset($curr_data)) continue; - for($j = $i+1; $j < $this->num; $j++) + for($j = $i-1; $j >= 0; $j--) { if($this->items[$j]["axisside"] != $this->items[$i]["axisside"]) continue; - $prev_data = &$this->data[$this->items[$i+1]["itemid"]][$this->items[$i+1]["type"]]; + $prev_data = &$this->data[$this->items[$j]["itemid"]][$this->items[$j]["type"]]; if(!isset($prev_data)) continue; @@ -1075,6 +1075,7 @@ $curr_shift[$ci] = $prev_var[$ci] + $prev_shift[$ci]; } } + break; } } } @@ -1175,7 +1176,7 @@ $maxX = $this->sizeX; // For each metric - for($item = $this->num-1; $item >=0; $item--) + for($item = 0; $item < $this->num; $item++) { $minY = $this->m_minY[$this->items[$item]["axisside"]]; $maxY = $this->m_maxY[$this->items[$item]["axisside"]]; @@ -1212,7 +1213,7 @@ { if($data->count[$i] == 0) continue; - $diff = $data->clock[$i] - $data->clock[$j]; + $diff = abs($data->clock[$i] - $data->clock[$j]); $cell = ($this->to_time - $this->from_time)/$this->sizeX; $delay = $this->items[$item]["delay"]; |
