From 2f691b3628c4589fe258def9564d78cd134d3ebb Mon Sep 17 00:00:00 2001 From: hugetoad Date: Sun, 4 Aug 2002 16:53:24 +0000 Subject: - added upgrades/dbpatches/1.0beta4_to_1.0beta5/ with patches (Alexei) - added support for disktotal[*] (Alexei) - added support for inodetotal[*] (Alexei) - added support for *,/,+, and - in trigger expressions (Alexei) - removed frontends/php/chart4.php (Alexei) - update item status to UNSUPPORTED in case if SNMP support was not included into zabbix_suckerd (Alexei) - added mysql_init() to DBconnect() (Alexei) - fixed Next100 and Prev100 for case if some hosts are hidden (Alexei) - added select for latest values (Alexei) - delete related services if trigger is deleted (Alexei) - fixed problem with substitution of macros for messages (Alexei) - eliminated DBis_empty() by replacing to DBnum_rows() (Alexei) - MAX_STRING_LEN increased to 4096 (Alexei) - fixed zabbix_log(). Possible coredump if data contains %s, etc (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@445 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/chart2.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'frontends/php/chart2.php') diff --git a/frontends/php/chart2.php b/frontends/php/chart2.php index b4b2b387..af5488bd 100644 --- a/frontends/php/chart2.php +++ b/frontends/php/chart2.php @@ -5,8 +5,10 @@ # graphid -#? period -#? from +# period +# from + + $start_time=time(NULL); if(!isset($period)) { @@ -29,14 +31,14 @@ $nodata=1; - Header( "Content-type: text/html"); -// Header( "Content-type: image/png"); +// Header( "Content-type: text/html"); + Header( "Content-type: image/png"); Header( "Expires: Mon, 17 Aug 1998 12:51:50 GMT"); $result2=DBselect("select gi.itemid,i.description,gi.color,h.host from graphs_items gi,items i,hosts h where gi.itemid=i.itemid and gi.graphid=$graphid and i.hostid=h.hostid order by gi.gitemid"); $shiftX=10; - $shiftYup=13; + $shiftYup=17; $shiftYdown=7+15*DBnum_rows($result2); $im = imagecreate($sizeX+$shiftX+61,$sizeY+$shiftYup+$shiftYdown+10+50); @@ -81,7 +83,9 @@ } $graph=get_graph_by_graphid($graphid); - ImageString($im, 4,$sizeX/2-50,-1, $graph["name"] , $darkred); + $str=$graph["name"]; + $x=imagesx($im)/2-ImageFontWidth(4)*strlen($str)/2; + ImageString($im, 4,$x,1, $str , $darkred); $from_time = time(NULL)-$period-3600*$from; $to_time = time(NULL)-3600*$from; @@ -180,7 +184,10 @@ } # ImageString($im,0,$shiftX+$sizeX-85,$sizeY+$shiftYup+25, "http://zabbix.sourceforge.net", $gray); - ImageStringUp($im,0,2*$shiftX+$sizeX+40,$sizeY+$shiftYdown+$shiftYup, "http://zabbix.sourceforge.net", $gray); + ImageStringUp($im,0,imagesx($im)-10,imagesy($im)-50, "http://zabbix.sourceforge.net", $gray); + + $end_time=time(NULL); + ImageString($im, 0,imagesx($im)-100,imagesy($im)-12,"Generated in ".($end_time-$start_time)." sec", $gray); ImagePng($im); ImageDestroy($im); -- cgit