1 ".$graph_title."
Horizontal Bar Chart
"; $sHTML .= render_graph($tmp_dir."hor_".$cache_file_name,$html_imagename."_hor",$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,"horizontal"); //Commented by Minnie -- same content displayed in to graphs /*$sHTML .= "
"; $sHTML .= "
2 ".$graph_title."
Vertical Bar Chart
"; $sHTML .= render_graph($tmp_dir."vert_".$cache_file_name,$html_imagename."_vert",$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,"vertical");*/ $sHTML .= "
"; $sHTML .= "
2 ".$graph_title."
Pie Chart
"; $sHTML .= render_graph($tmp_dir."pie_".$cache_file_name,$html_imagename."_pie",$cnt_val,$name_val,$width,$height,40,$right,$top,$bottom,$title,$target_val,"pie"); $sHTML .= "
"; return $sHTML; } /** Returns graph, if the cached image is present it'll display that image, otherwise it will render the graph with the given details * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. * Contributor(s): ______________________________________.. */ // Function to get the chached image if exists function render_graph($cache_file_name,$html_imagename,$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$graph_type) { //Checks whether the cached image is present or not if(file_exists($cahce_file_name)) { unlink($cache_file_name); } if(file_exists($cache_file_name.'.map')) { unlink($cache_file_name.'.map'); } if (!file_exists($cache_file_name) || !file_exists($cache_file_name.'.map')) { //If the Cached image is not present if($graph_type=="horizontal") { return horizontal_graph($cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$cache_file_name,$html_imagename); } else if($graph_type=="vertical") { return vertical_graph($cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$cache_file_name,$html_imagename); } else if($graph_type=="pie") { return pie_chart($cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$cache_file_name,$html_imagename); } } else { //Getting the cached image $imgMap_fp = fopen($cache_file_name.'.map', "rb"); $imgMap = fread($imgMap_fp, vtiger_filesize($cache_file_name.'.map')); fclose($imgMap_fp); $base_name_cache_file=basename($cache_file_name); $ccc="cache/images/".$base_name_cache_file; $return = "\n$imgMap\n"; $return .= ""; return $return; } } ?>