| Server IP : 127.0.0.1 / Your IP : 192.168.99.1 Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9 System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64 User : Administrator ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/laragon3/www/perpusweb/mpdf60/graph_cache/src/Examples/ |
Upload File : |
<?php // content="text/plain; charset=utf-8"
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_bar.php');
$datay=array(12,0,-19,-7,17,-6);
// Create the graph.
$graph = new Graph(400,300);
$graph->img->SetMargin(60,30,40,40);
$graph->SetScale("textlin");
$graph->SetShadow();
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("orange");
// DIsplay value at top of each bar
$bplot->value->Show();
$bplot->SetShadow();
$graph->Add($bplot);
// Position the scale at the min of the other axis
$graph->xaxis->SetPos("min");
// Add 10% more space at top and bottom of graph
$graph->yscale->SetGrace(10,10);
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_VERDANA,FS_NORMAL,12);
$graph->title->Set("Example of bar plot with absolute labels");
$graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,16);
$graph->Stroke();
?>