diff options
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"]; |