| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/php/jpgraph/src/Examples/ |
Upload File : |
<?php // content="text/plain; charset=utf-8"
require_once ('../jpgraph.php');
require_once ('../jpgraph_bar.php');
$datay=array(12,26,9,17,31);
// Create the graph.
$graph = new Graph(400,250);
$graph->SetScale('textlin');
$graph->SetMargin(50,80,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
$n = count($datay) ; // Number of bars
global $_wrapperfilename;
// Create targets for the image maps. One for each column
$targ = array(); $alt = array(); $wtarg = array();
for( $i=0; $i < $n; ++$i ) {
$urlarg = 'clickedon='.($i+1);
$targ[] = $_wrapperfilename.'?'.$urlarg;
$alt[] = 'val=%d';
$wtarg[] = '';
}
$bplot->SetCSIMTargets($targ,$alt,$wtarg);
$graph->Add($bplot);
$graph->title->Set('Multiple Image maps');
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->title->SetCSIMTarget('#45','Title for Bar','_blank');
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetCSIMTarget('#55','Y-axis title');
$graph->yaxis->title->Set("Y-title");
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetCSIMTarget('#55','X-axis title');
$graph->xaxis->title->Set("X-title");
// Send back the image when we are called from within the <img> tag
$graph->StrokeCSIMImage();
?>