There are two methods to do this:
- GettingHoldOfImageMap
- Using StrokeCSIM
include ("../../../../jpgraph/src/jpgraph.php");
include ("../../../../jpgraph/src/jpgraph_pie.php");
include ("../../../../jpgraph/src/jpgraph_pie3d.php");
$graph = new PieGraph(600,600);
$graph->SetShadow();
$graph->title->Set("Incoming Traffic - IP Occurrences");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
/// using this we can click Title///
$graph->title->SetCSIMTarget('#99','Incoming Traffic');
$p1 = new PiePlot3D($data);
///those targets can get using GET method//
$targets = array('?path = 11', '?path = 22','?path = 44','?path = 66','?path = 55');
$alts = $dataIP;
/// Because of Using this SetCSIMTargets method, we can click image///
$p1->SetCSIMTargets($targets,$alts);
$p1->SetLegends($dataIP);
$graph->Add($p1);
$graph->Stroke();
/// Using this STROKE method , get image to the web page ///
/* if we use this Stroke method only, we can not add any other item (ex: text, table,etc...). therefore I used a method to solve that problem .
- that is : save image another folder and send that image to the server and get back to the web page.
///this is the first method "1. GettingHoldOfImageMap"
$graph->Stroke( "/opt/lampp/htdocs/Test/img/image001.png" ); /// Using this Stroke methode we can save image .
echo $graph ->GetHTMLImageMap ("myimagemap001" );
///note : you have to replace image path with the
/// this is the second method 2.Using StrokeCSIM
//~ $graph-> StrokeCSIM( basename( __FILE__)); //using this "basename(_FILE_)" we can save as same as PHP file name or we can use this
//~ $graph-> StrokeCSIM( 'creatImg.php');
?>
Check the My other post also