X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=rantest%2Fweb%2FRantest%2FGraphStats.php;fp=rantest%2Fweb%2FRantest%2FGraphStats.php;h=bcff64ed673080cfdbf363b6b9b72952f8b69894;hb=8ec853edfd2e5666d8e76fb58bb95da7b4ccfbf6;hp=0000000000000000000000000000000000000000;hpb=b1f5fe3b3f099b5d0ffbf406dd4bee2c35522813;p=clearscm.git diff --git a/rantest/web/Rantest/GraphStats.php b/rantest/web/Rantest/GraphStats.php new file mode 100644 index 0000000..bcff64e --- /dev/null +++ b/rantest/web/Rantest/GraphStats.php @@ -0,0 +1,100 @@ +AddPoint ($result["Success"], "Passed", $reportDate); + $DataSet->AddPoint ($result["Failure"], "Failed"); +} // foreach + +$DataSet->AddAllSeries (); +$DataSet->SetAbsciseLabelSerie (); + +$DataSet->SetSerieName ("Passed", "Passed"); +$DataSet->SetSerieName ("Failed", "Failed"); + +// Initialise the graph +$Test = new pChart (700, 280); +$Test->drawGraphAreaGradient (100, 150, 175, 100, TARGET_BACKGROUND); +$Test->setFontProperties ("$fonts/tahoma.ttf", 8); +$Test->setGraphArea (50, 30, 680, 200); +$Test->drawRoundedRectangle (5, 5, 695, 275, 5, 230, 230, 230); +$Test->drawGraphAreaGradient (162, 183, 202, 50); +$Test->drawScale ($DataSet->GetData (), $DataSet->GetDataDescription (), SCALE_ADDALL, 200, 200, 200, true, 70, 2, true); +$Test->drawGrid (4, true, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties ("$fonts/tahoma.ttf", 6); +$Test->drawTreshold (0, 143, 55, 72, true, true); + +// Draw the bar graph +$Test->drawStackedBarGraph ($DataSet->GetData (), $DataSet->GetDataDescription (), 75); + +// Finish the graph +$Test->setFontProperties ("$fonts/tahoma.ttf",8); +$Test->drawLegend (610, 35, $DataSet->GetDataDescription (), 130, 180, 205); +$Test->setFontProperties ("$fonts/tahoma.ttf", 10); +$Test->drawTitle (50, 22, "Test Metrics ($type)", 255, 255, 255, 675); +$Test->Stroke ();