cant get to work the CSIM targets on ScatterPlot. I hope im writing proper code:
<?php
require_once '/usr/local/lib/php/jpgraph.php';
require_once '/usr/local/lib/php/jpgraph_bar.php';
require_once '/usr/local/lib/php/jpgraph_line.php';
include ("/usr/local/lib/php/jpgraph_scatter.php");
$graph_name = 'zoltar.jpg';
$data['plan'] = array (
11.5, 12, 12, 14.5, 10, 9.5,
11, 12, 10, 11, 13, 12.5 );
$data['xdata'] = array (
1, 2, 4, 6, 8, 10, 12,
14, 16, 18, 20, 22 );
$targ = $alt = array();
for($i=0,$j=count( $data['plan'] ); $i<$j; $i++) {
$targ[] = $_SERVER['PHP_SELF'];
$alt[] = sprintf("Point %s\nSeries 1=%s", $i+1,$data['plan']);
}
$graph = new Graph(500,200,$graph_name,0,0);
$graph->img->SetMargin(30,30,30,30);
$graph->setScale('linlin');
$b1 =& new ScatterPlot($data['plan'],$data['xdata']);
$b1->SetLinkPoints(true,red,1 );
$b1->mark->SetType(MARK_NONE);
$b1->SetCSIMTargets($targ,$alt);
$graph->Add($b1);
$line = new PlotLine(VERTICAL,5,"blue",3);
$graph->AddLine($line);
$graph->Stroke($graph_name);
$mapName = 'TestMap';
$imgMap = $graph->GetHTMLImageMap($mapName);
print ("$imgMap <img src='$graph_name' alt='test' ismap usemap='#$mapName' border='0'> ");
?>
Also wanted to know if its possible that when the user clicks on any of the target ie link, the vertical line should move to where the user has clicked.
Thanks in advance for the help
regards
zoltarb