| Server IP : 104.21.80.248 / Your IP : 172.71.28.155 Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586 User : SYSTEM ( 0) PHP Version : 5.6.30 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : E:/Inetpub/www/myschool/triamudom/check/webadmin/S_Graph/jpgraph/Examples/ |
Upload File : |
<?php // content="text/plain; charset=utf-8"
require_once "jpgraph/jpgraph.php";
require_once "jpgraph/jpgraph_canvas.php";
// Caption below the image
$txt="The day was rapidly becoming more and\nmore strange.\n\nNot only had he managed to\nget by the first pass without so much as\na hint of questions but now when he\ncould feel that the second pass wouldn't\nlong be noone had yet seen him.";
$w=950;$h=250;
$xm=20;$ym=20;
$tw=300;
$g = new CanvasGraph($w,$h);
$img = $g->img;
// Alignment for anchor points to use
$palign = array('left','center','right');
$n = count($palign);
$t = new Text($txt);
$y = $ym;
for( $i=0; $i < $n; ++$i ) {
$x = $xm + $i*$tw;
$t->SetColor('black');
$t->SetAlign('left','top');
$t->SetFont(FF_ARIAL,FS_NORMAL,11);
$t->SetBox();
$t->SetParagraphAlign($palign[$i]);
$t->Stroke($img, $x,$y);
$img->SetColor('black');
$img->SetFont(FF_FONT1,FS_BOLD);
$img->SetTextAlign('center','top');
$img->StrokeText($x+140,$y+160,'"'.$palign[$i].'"'.' pargraph align');
}
// .. and send back to browser
$g->Stroke();
?>