summaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-03-26 14:30:27 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-03-26 14:30:27 +0000
commitb09b9afef4f9b1e1d29f5b759832554dab0c9cc8 (patch)
tree117d36c0c45cfb286c43d7b0ee1881f867a1a5cd /frontends
parentfca93a0754ca3124185dbebbc2431c6c5f4d774b (diff)
downloadzabbix-b09b9afef4f9b1e1d29f5b759832554dab0c9cc8.tar.gz
zabbix-b09b9afef4f9b1e1d29f5b759832554dab0c9cc8.tar.xz
zabbix-b09b9afef4f9b1e1d29f5b759832554dab0c9cc8.zip
- added units to "Pie graphs" (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5538 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends')
-rw-r--r--frontends/php/chart6.php2
-rw-r--r--frontends/php/chart7.php2
-rw-r--r--frontends/php/charts.php18
-rw-r--r--frontends/php/include/classes/pie.inc.php7
-rw-r--r--frontends/php/include/page_header.php4
5 files changed, 14 insertions, 19 deletions
diff --git a/frontends/php/chart6.php b/frontends/php/chart6.php
index 6ce57448..0149f4ed 100644
--- a/frontends/php/chart6.php
+++ b/frontends/php/chart6.php
@@ -23,7 +23,7 @@
require_once "include/graphs.inc.php";
require_once "include/classes/pie.inc.php";
- $page["file"] = "chart2.php";
+ $page["file"] = "chart6.php";
$page["title"] = "S_CHART";
$page["type"] = PAGE_TYPE_IMAGE;
diff --git a/frontends/php/chart7.php b/frontends/php/chart7.php
index d048adbc..1bcf5046 100644
--- a/frontends/php/chart7.php
+++ b/frontends/php/chart7.php
@@ -23,7 +23,7 @@
require_once "include/graphs.inc.php";
require_once "include/classes/pie.inc.php";
- $page["file"] = "chart3.php";
+ $page["file"] = "chart7.php";
$page["title"] = "S_CHART";
$page["type"] = PAGE_TYPE_IMAGE;
diff --git a/frontends/php/charts.php b/frontends/php/charts.php
index 1e69a83a..6eb861df 100644
--- a/frontends/php/charts.php
+++ b/frontends/php/charts.php
@@ -428,15 +428,8 @@ include_once 'include/page_header.php';
if(($graphtype == GRAPH_TYPE_PIE) || ($graphtype == GRAPH_TYPE_EXPLODED)){
$row = "\n".'<script language="javascript" type="text/javascript">
<!--
- A_SBOX["'.$dom_graph_id.'"] = new Object;
- A_SBOX["'.$dom_graph_id.'"].shiftT = 17;
- A_SBOX["'.$dom_graph_id.'"].shiftL = '.$shiftXleft.';
-
- var ZBX_G_WIDTH = get_bodywidth();
- ZBX_G_WIDTH-= parseInt('.($shiftXleft+$shiftXright).'+parseInt((SF)?10:10));
-
document.write(\'<img id="'.$dom_graph_id.'" src="chart6.php?graphid='.$_REQUEST['graphid'].url_param('stime').
- '&period='.$effectiveperiod.'&width=\'+ZBX_G_WIDTH+\'" /><br />\');
+ '&period='.$effectiveperiod.'" /><br />\');
-->
</script>'."\n";
}
@@ -473,10 +466,11 @@ include_once 'include/page_header.php';
$bstime = mktime(substr($bstime,8,2),substr($bstime,10,2),0,substr($bstime,4,2),substr($bstime,6,2),substr($bstime,0,4));
}
- $script = 'scrollinit(0,0,0,'.$effectiveperiod.','.$stime.',0,'.$bstime.');
- showgraphmenu("graph");
- graph_zoom_init("'.$dom_graph_id.'",'.$bstime.','.$effectiveperiod.',ZBX_G_WIDTH,'.$graph_height.');
- ';
+ $script = 'scrollinit(0,0,0,'.$effectiveperiod.','.$stime.',0,'.$bstime.'); showgraphmenu("graph");';
+
+ if(($graphtype == GRAPH_TYPE_NORMAL) || ($graphtype == GRAPH_TYPE_STACKED)){
+ $script.= 'graph_zoom_init("'.$dom_graph_id.'",'.$bstime.','.$effectiveperiod.',ZBX_G_WIDTH,'.$graph_height.');';
+ }
zbx_add_post_js($script);
// navigation_bar('charts.php',array('groupid','hostid','graphid'));
diff --git a/frontends/php/include/classes/pie.inc.php b/frontends/php/include/classes/pie.inc.php
index 4eae1894..dadc4bc4 100644
--- a/frontends/php/include/classes/pie.inc.php
+++ b/frontends/php/include/classes/pie.inc.php
@@ -173,7 +173,7 @@ function selectData(){
}
$this->sum += $item_value;
- $strvaluelength = max($strvaluelength,strlen($item_value));
+ $strvaluelength = max($strvaluelength,strlen(convert_units($item_value,$this->items[$i]['unit'])));
}
if(isset($graph_sum)) $this->sum = $graph_sum;
@@ -303,9 +303,10 @@ function drawLegend(){
}
$proc = ($datavalue * 100)/ $this->sum;
-
+// convert_units($datavalue,$this->items[$i]["units"]),
if(isset($data) && isset($datavalue)){
- $strvalue = sprintf(S_VALUE.': '.((round($datavalue)!=$datavalue)?'%0.4f':'%s').' ('.((round($proc)!=$proc)?'%0.2f':'%s')."%s)",$datavalue,$proc,'%');
+ $strvalue = sprintf(S_VALUE.': %s ('.((round($proc)!=$proc)?'%0.2f':'%s')."%s)",convert_units($datavalue,$this->items[$i]["units"]),$proc,'%');
+
$str = sprintf('%s: %s [%s] ',
str_pad($this->items[$i]['host'],$max_host_len,' '),
str_pad($this->items[$i]['description'],$max_desc_len,' '),
diff --git a/frontends/php/include/page_header.php b/frontends/php/include/page_header.php
index c65c29f0..e023441b 100644
--- a/frontends/php/include/page_header.php
+++ b/frontends/php/include/page_header.php
@@ -105,7 +105,7 @@ COpt::profiling_start("page");
array(
"url"=>"dashboard.php",
"label"=>S_DASHBOARD,
- "sub_pages"=>array("chart2.php","charts.php","screens.php","maps.php","map.php")
+ "sub_pages"=>array("chart2.php","chart6.php","charts.php","screens.php","maps.php","map.php")
),
array("url"=>"overview.php" ,"label"=>S_OVERVIEW ),
array(
@@ -139,7 +139,7 @@ COpt::profiling_start("page");
"url"=>"srv_status.php",
"label"=>S_IT_SERVICES,
'forse_disable_subnodes' => true,
- "sub_pages"=>array("report3.php","chart_sla.php","chart5.php")
+ "sub_pages"=>array("report3.php","report7.php","chart_sla.php","chart5.php")
),
array("url"=>"vtext.php"),
array("url"=>"chart3.php")