abreBanco(); $n= $genopar->queryBanco(" SELECT CONCAT('#', g.color) as color, g.code as code, g.descr as descr, COUNT(g.code) as COGs FROM anotacao a, COG c, groupsCOG g WHERE a.idMontagem = '$mtg' AND a.COGid = c.id AND g.code = SUBSTRING(a.function,1,1) GROUP BY g.group ORDER BY g.group DESC "); $total=0; $color= $cogs= $fun= $leituras= $url1= $url2= $desc= array(); while ($lin= $genopar->getArray()) { if ($lin['code']) array_push($desc, $lin['code']." - ".$lin['descr']." - ".$lin['COGs']); else array_push($desc, "Não anotados - ".$lin['COGs']); $total += $lin['COGs']; array_push($url1, "#"); array_push($url2, "#"); array_push($cogs, $lin['COGs']); array_push($color, $lin['color']); } // Create the Pie Graph. $graph = new PieGraph(450,400,'auto'); $graph->SetShadow(); // Set A title for the plot $graph->title->Set("Grupos Funcionais - COG (genes: $total)"); $graph->title->SetFont(FF_VERDANA,FS_BOLD,14); $graph->title->SetColor("darkblue"); $graph->legend->Pos(0.01,0.98,'right','bottom'); $graph->legend->SetColumns(5); $graph->legend->SetColor('black','white'); $graph->legend->SetFillColor('white'); $graph->legend->SetShadow(0); $p2 = new PiePlot3d(array_values($cogs)); $p2->SetSliceColors($color); $p2->SetHeight(20); $p2->SetLabelType(PIE_VALUE_PER); $p2->SetAngle(85); $p2->value->SetFont(FF_ARIAL,FS_NORMAL,9); $p2->SetSize(0.35); // $p2->SetCenter(0.70,0.4); $p2->ExplodeAll(7); // You can explode several slices by specifying the explode // distance for some slices in an array //$p1->Explode(array(0,40,0,30)); // As a shortcut you can easily explode one numbered slice with // $p1->ExplodeSlice(3); // $p1->SetLegends(array_values($lgd)); //$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct")); // $p1->SetCSIMTargets($url1,$desc); $p2->SetCSIMTargets($url2,$desc); // $graph->Add($p1); $graph->Add($p2); $graph->StrokeCSIM(basename(__FILE__)); ?>