=14) $name=substr($name, 0, 34); if($pos>=2) { $val=explode(" ",$name); $n=count($val)-1; $x=""; for($j=0;$j $width, 'height' => $height, 'usemap' => true)); $imagemap = $canvas->getImageMap(); $graph =& Image_Graph::factory('graph', $canvas); $font =& $graph->addNew('font', calculate_font_name($lang_crm)); // set the font size to 11 pixels $font->setSize(8); $font->setColor($font_color); $graph->setFont($font); // create the plotarea layout $title =& Image_Graph::factory('title', array($title,10)); $plotarea =& Image_Graph::factory('plotarea',array( 'category', 'axis' )); $footer =& Image_Graph::factory('title', array('Footer',8)); $legend_box =& Image_Graph::factory('legend'); $graph->add( Image_Graph::vertical($title, $plotarea, 5 ) ); // To create unique lables we need to keep track of lable name and its count $uniquex = array(); // Generate colours $colors = color_generator(count($datay),'#33DDFF','#3322FF'); $dataset = & Image_Graph::factory('dataset'); $fills =& Image_Graph::factory('Image_Graph_Fill_Array'); $sum = 0; for($i=0;$iaddPoint( $datalabel, $datay[$i], array( 'url' => $target[$i], 'alt' => $alts[$i] ) ); $sum += $datay[$i]; $fills->addColor($colors[$i]); } // create an array with % values $pcvalues = array(); for($i=0;$iaddNew('pie', $dataset); $plotarea->setPadding(array('top'=>20,'bottom'=>0,'left'=>0,'right'=>50)); $plotarea->hideAxis(); $gbplot->setFillStyle($fills); // format the data values $marker_array =& Image_Graph::factory('Image_Graph_DataPreprocessor_Array', array($pcvalues)); // set markers $marker =& $graph->addNew('value_marker', IMAGE_GRAPH_VALUE_Y); $marker->setDataPreprocessor($marker_array); $marker->setFillColor('#FFFFFF'); $marker->setBorderColor($font_color); $marker->setFontColor($font_color); $marker->setFontSize(8); $pointingMarker =& $graph->addNew('Image_Graph_Marker_Pointing_Angular', array(20, &$marker)); $gbplot->setMarker($pointingMarker); // set legend $legend_box =& $plotarea->addNew('legend'); $legend_box->setPadding(array('top'=>20,'bottom'=>0,'left'=>0,'right'=>0)); $legend_box->setFillColor('#F5F5F5'); $legend_box->showShadow(); $img = $graph->done( array( 'tohtml' => true, 'border' => 0, 'filename' => $cache_file_name, 'filepath' => '', 'urlpath' => '' )); save_image_map($cache_file_name.'.map', $img); return $img; } ?>