//$graph->subtitle->SetFont(FF_FONT0,FS_NORMAL); $p1 = new PiePlot($data); $p1->ExplodeSlice(0); // make the largest slice explode out from the rest #$p1->ExplodeAll(); //$p1->SetStartAngle(45); if (imgdef($q['slices']['border'], 0) == 0) { $p1->ShowBorder(false, false); } $p1->SetGuideLines(); $p1->SetCenter(0.35); $p1->SetTheme(imgdef($q['slices']['theme'], 'earth')); $p1->SetLegends($labels); $p1->SetGuideLinesAdjust(1.1); $graph->SetMarginColor(imgdef($q['frame']['margin'], '#d7d7d7')); $graph->SetFrame(true, imgdef($q['frame']['color'], 'gray'), imgdef($q['frame']['width'], 1)); $graph->Add($p1); /* if (count($data)) { $t = new Text("Not enough history\navailable\nto display piechart"); $t->SetPos(0.5,0.5,'center','center'); $t->SetFont(FF_FONT2, FS_BOLD); $t->ParagraphAlign('centered'); $t->SetBox('lightyellow','black','gray'); $t->SetColor('orangered4'); // $graph->legend->Hide(); $graph->AddText($t); } */ stdImgFooter($graph); $graph->Stroke();
$avg = intval($avg); if ($avg) { $avgdata = array(); for ($i = 0; $i < count($datay) * $smooth; $i++) { $avgdata[] = $avg; } $p2 = new LinePlot($avgdata); // $p2->SetStyle('dashed'); $p2->SetLegend(imgdef($q['frame']['plot'][1]['_content'], 'Average') . " [{$avg}]"); $p2->SetWeight(imgdef($q['frame']['plot'][1]['weight'], 2)); $p2->SetColor(imgdef($q['frame']['plot'][1]['color'], 'khaki4')); $p2->SetBarCenter(); $graph->Add($p2); $graph->legend->SetAbsPos(imgdef($q['legend']['x'], 20), imgdef($q['legend']['y'], 15), imgdef($q['legend']['halign'], 'right'), imgdef($q['legend']['valign'], 'top')); $graph->legend->SetFillColor(imgdef($q['legend']['color'], 'lightblue@0.5')); $graph->legend->SetShadow(imgdef($q['legend']['shadow']['color'], 'gray@0.5'), imgdef($q['legend']['shadow']['width'], '2')); } $graph->Add($p1); /* $p3 = new LinePlot($kills); $p3->SetBarCenter(); $p3->SetLegend("Kills"); $p3->SetFillColor('gray@0.65'); $graph->AddY2($p3); /**/ if (!$sum) { $t = new Text("Not enough history\navailable\nto chart graph"); $t->SetPos(0.5, 0.5, 'center', 'center'); $t->SetFont(FF_FONT2, FS_BOLD); $t->ParagraphAlign('centered');