1<?php // content="text/plain; charset=utf-8" 2require_once '../jpgraph.php'; 3require_once '../jpgraph_bar.php'; 4 5$datay = array(12, 26, 9, 17, 31); 6 7// Create the graph. 8$graph = new Graph\Graph(400, 250); 9$graph->SetScale('textlin'); 10$graph->SetMargin(50, 80, 20, 40); 11 12// Create a bar pot 13$bplot = new Plot\BarPlot($datay); 14 15$n = count($datay); // Number of bars 16 17global $_wrapperfilename; 18 19// Create targets for the image maps. One for each column 20$targ = array(); 21$alt = array(); 22$wtarg = array(); 23for ($i = 0; $i < $n; ++$i) { 24 $urlarg = 'clickedon=' . ($i + 1); 25 $targ[] = $_wrapperfilename . '?' . $urlarg; 26 $alt[] = 'val=%d'; 27 $wtarg[] = ''; 28} 29$bplot->SetCSIMTargets($targ, $alt, $wtarg); 30 31$graph->Add($bplot); 32 33$graph->title->Set('Multiple Image maps'); 34$graph->title->SetFont(FF_FONT1, FS_BOLD); 35$graph->title->SetCSIMTarget('#45', 'Title for Bar', '_blank'); 36 37$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD); 38$graph->yaxis->title->SetCSIMTarget('#55', 'Y-axis title'); 39$graph->yaxis->title->Set("Y-title"); 40 41$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD); 42$graph->xaxis->title->SetCSIMTarget('#55', 'X-axis title'); 43$graph->xaxis->title->Set("X-title"); 44 45// Send back the image when we are called from within the <img> tag 46$graph->StrokeCSIMImage(); 47