[ Index ] |
|
Code source de vtiger CRM 5.0.2 |
1 <?php 2 /********************************************************************************* 3 ** The contents of this file are subject to the vtiger CRM Public License Version 1.0 4 * ("License"); You may not use this file except in compliance with the License 5 * The Original Code is: vtiger CRM Open Source 6 * The Initial Developer of the Original Code is vtiger. 7 * Portions created by vtiger are Copyright (C) vtiger. 8 * All Rights Reserved. 9 * 10 ********************************************************************************/ 11 12 include ("../../jpgraph/src/jpgraph.php"); 13 include ("../../jpgraph/src/jpgraph_bar.php"); 14 15 $refer_code=(isset($_REQUEST['width']))?$_REQUEST['refer_code']:"0,0"; 16 $referdata=(isset($_REQUEST['referdata']))?$_REQUEST['referdata']:"null"; //The Status Name 17 $datavalue=(isset($_REQUEST['datavalue']))?$_REQUEST['datavalue']:"0,K,0"; 18 $width=(isset($_REQUEST['width']))?$_REQUEST['width']:410; 19 $height=(isset($_REQUEST['height']))?$_REQUEST['height']:270; 20 $left=(isset($_REQUEST['left']))?$_REQUEST['left']:110; 21 $right=(isset($_REQUEST['right']))?$_REQUEST['right']:20; 22 $top=(isset($_REQUEST['top']))?$_REQUEST['top']:40; 23 $bottom=(isset($_REQUEST['bottom']))?$_REQUEST['bottom']:50; 24 $title=(isset($_REQUEST['title']))?$_REQUEST['title']:"Horizontal graph"; 25 $target_val=(isset($_REQUEST['test']))?$_REQUEST['test']:""; 26 //Exploding the data values 27 $datavalue=explode("K",$datavalue); 28 $name_value=explode(",",$referdata); 29 $datax=explode(",",$refer_code); //The values to the XAxis 30 $target_val=urldecode($target_val); 31 $target_val=explode("K",$target_val); 32 33 34 35 36 $color_array=array("#FF8B8B","#8BFF8B","#A8A8FF","#FFFF6E","#C5FFFF","#FFA8FF","#FFE28B","lightpink","burlywood2","cadetblue"); 37 38 // Create the graph. These two calls are always required 39 $graph = new Graph($width,$height,"auto"); 40 $graph->SetScale("textlin"); 41 42 $graph->SetShadow(); 43 44 45 // Create the lines of the Graph 46 for($i=0;$i<count($datavalue);$i++) 47 { 48 $data=$datavalue[$i]; 49 $target=$target_val[$i]; 50 $graph_data=explode(",",$data); 51 $data[$i]=$data; 52 $bplot[$i] = new BarPlot($graph_data); 53 $bplot[$i]->SetFillColor($color_array[$i]); 54 $bplot[$i]->SetWidth(10); 55 56 $bplot[$i]->value->Show(); 57 $bplot[$i]->value->SetFont(FF_FONT1,FS_NORMAL,8); 58 $bplot[$i]->value->SetColor("black"); 59 $bplot[$i]->value->SetFormat('%d'); 60 $bplot[$i]->SetValuePos('max'); 61 62 } 63 64 $gbplot = new AccBarPlot($bplot); 65 $gbplot->SetWidth(0.7); 66 67 // Add the bar to the graph 68 $graph->Add($gbplot); 69 70 $graph->xaxis->SetTickLabels($datax); 71 72 $graph->title->Set($title); 73 74 $graph->Set90AndMargin($left,$right,$top,$bottom); 75 //$graph->SetFrame(false); 76 $graph->title->SetFont(FF_FONT1,FS_BOLD); 77 $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); 78 $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); 79 80 $graph->SetColor("#7D9CB8"); 81 $graph->SetMarginColor("#3D6A93"); 82 83 // Display the graph 84 $graph->Stroke(); 85 86 ?> 87
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 10:22:19 2007 | par Balluche grâce à PHPXref 0.7 |