diff options
author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-02-01 09:27:10 +0000 |
---|---|---|
committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-02-01 09:27:10 +0000 |
commit | c17c948ea64b3d38bcd289da57948c172892985c (patch) | |
tree | a8b479595e876a618a8f92f972201dd83a1b3b9a /frontends/php | |
parent | 5298227fab3d35cccaf6511f1e8766f3beaa3709 (diff) | |
download | zabbix-c17c948ea64b3d38bcd289da57948c172892985c.tar.gz zabbix-c17c948ea64b3d38bcd289da57948c172892985c.tar.xz zabbix-c17c948ea64b3d38bcd289da57948c172892985c.zip |
fixed stacked graphs
git-svn-id: svn://svn.zabbix.com/trunk@3778 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
-rw-r--r-- | frontends/php/include/classes/graph.inc.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/frontends/php/include/classes/graph.inc.php b/frontends/php/include/classes/graph.inc.php index 6ae5ba44..177c4759 100644 --- a/frontends/php/include/classes/graph.inc.php +++ b/frontends/php/include/classes/graph.inc.php @@ -260,10 +260,10 @@ $this->items[$this->num]["calc_type"] = is_null($type) ? GRAPH_ITEM_SIMPLE : $type; $this->items[$this->num]["periods_cnt"] = is_null($periods_cnt) ? 0 : $periods_cnt; - if($this->items[$this->num]["calc_fnc"] == GRAPH_YAXIS_SIDE_LEFT) + if($this->items[$this->num]["axisside"] == GRAPH_YAXIS_SIDE_LEFT) $this->yaxisleft=1; - if($this->items[$this->num]["calc_fnc"] == GRAPH_YAXIS_SIDE_RIGHT) + if($this->items[$this->num]["axisside"] == GRAPH_YAXIS_SIDE_RIGHT) $this->yaxisright=1; $this->num++; @@ -1039,7 +1039,13 @@ } /* calculate missed points */ + $first_idx = 0; + /* + ci - current index + cj - count of missed + dx - offset to first value + */ for($ci = 0, $cj=0; $ci < $this->sizeX; $ci++) { if(!isset($curr_data->count[$ci]) || $curr_data->count[$ci] == 0) @@ -1066,12 +1072,12 @@ if($first_idx == $ci && $var_name == 'clock') { - $var[$ci - $cj] = $var[$first_idx] - ($p / $this->sizeX * $cj); + $var[$ci - ($dx - $cj)] = $var[$first_idx] - ($p / $this->sizeX * $cj); continue; } $dy = $var[$ci] - $var[$first_idx]; - $var[$ci - $cj] = $var[$first_idx] + ($cj * $dy) / $dx; + $var[$ci - ($dx - $cj)] = $var[$first_idx] + ($cj * $dy) / $dx; } } } @@ -1090,10 +1096,10 @@ if($var_name == 'clock') { - $var[$first_idx + $cj] = $var[$first_idx] + ($p / $this->sizeX * $cj); + $var[$first_idx + ($dx - $cj)] = $var[$first_idx] + ($p / $this->sizeX * $cj); continue; } - $var[$first_idx + $cj] = $var[$first_idx]; + $var[$first_idx + ($dx - $cj)] = $var[$first_idx]; } } } @@ -1102,7 +1108,8 @@ } /* calculte shift for stacked graphs */ - if($this->type == GRAPH_TYPE_STACKED /* stacked graph */) + + if($this->type == GRAPH_TYPE_STACKED) { for($i=1; $i<$this->num; $i++) { |