abreBanco(); verGetPost(array("bco", "biblio")); unset($lab); if (isset($biblio) && !isset($bco)) $bco= $biblio; $plots=array("bp0","bp1","bp2","bp3","bp4","bp5","bp6","bp7","bp8","bp9", "bp10","bp11","bp12","bp13","bp14","bp15","bp16","bp17","bp18","bp19"); $cores=array("blue","red","seagreen4","silver","yellow","darkorchid1", "cornsilk","chocolate","cadetblue4","black","blueviolet", "green","lightsteelblue","orange","deeppink","plum3","mintcream", "mediumorchid4","lightyellow","lightpink","lightgoldenrod4"); $labs= $meses= $reads= $reads_ok= array(); $n= $genopar->queryBanco("select lab, count(*) as qtd_reads, concat(month(dt_sub),'-',year(dt_sub)) as mes from prod " .(isset($bco) ? "where bco='$bco'":""). " group by lab, concat(year(dt_sub),month(dt_sub)) order by dt_sub"); #$lab=""; $labelx=array(); while ($lin= $genopar->getArray()) { $labs[$lin["lab"]]++; $meses[$lin["mes"]]++; $reads[$lin["lab"]][$lin["mes"]]= $lin["qtd_reads"]; } $n= $genopar->queryBanco("select concat(month(dt_sub),'-',year(dt_sub)) as mes from prod group by concat(year(dt_sub),month(dt_sub)) order by dt_sub"); while ($lin= $genopar->getArray()) array_push($labelx, $lin["mes"]); #construir array de valores para cada lab. foreach ($labs as $lab => $tmp) { $$lab= array(); foreach ($meses as $mes => $tmp) { if ($reads[$lab][$mes] > 0) array_push($$lab, $reads[$lab][$mes]); else array_push($$lab, 0); #echo "
:$lab:$mes:".$$lab[$mes].":"; } } $graph = new Graph(600,400); $graph->SetScale("textlin"); $graph->xaxis->SetTickLabels($labelx); $graph->xaxis->SetTextTickInterval(1); $graph->xaxis->SetFont(FF_FONT1); $graph->xaxis->SetLabelAngle(90); $graph->img->SetMargin(55,90,40,70); $graph->SetShadow(); $graph->SetGridDepth(DEPTH_FRONT); $graph->title->Set("Submissoes de Sequencias por Laboratorio por Mes"); $graph->title->SetFont(FF_FONT1,FS_BOLD); if (isset($bco)) $graph->subtitle->Set("Especificado para a Biblioteca $bco"); $graph->xaxis->SetTitlemargin(35); $graph->yaxis->SetTitlemargin(42); $graph->xaxis->title->Set("Mes - Ano"); $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); $graph->yaxis->title->Set("Numero de Submissoes"); $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); $graph->legend->Pos(0.02,0.05,'right','top'); $qtd=0; $AccBarPlot=array(); foreach ($labs as $lab => $tmp) { $plot= $plots[$qtd]; $$plot = new BarPlot($$lab); $$plot->SetWidth(0.6); $$plot->SetFillColor($cores[$qtd]); #$$plot->SetFillGradient("navy","lightsteelblue",GRAD_WIDE_MIDVER); #$$plot->SetColor("navy"); $$plot->SetLegend($lab); array_push($AccBarPlot,$$plot); $qtd++; } $abplot = new AccBarPlot($AccBarPlot); $graph->Add($abplot); $txt=new Text("GENOPAR"); $txt->SetPos(2,2); $txt->SetColor("snow1"); $txt->SetFont(FF_FONT1, FS_BOLD, 7); $graph->AddText($txt); $graph->Stroke(); ?>