diff --git a/jpgraph.php b/jpgraph.php new file mode 100644 index 000000000..987438c6b --- /dev/null +++ b/jpgraph.php @@ -0,0 +1,90 @@ +testsuite as $suite) { + foreach ($suite->testcase as $test) { + $name = (string)$suite['name'] . '#' . (string)$test['name']; + $graphs[$name][] = (double)$test['time']; + } + } +} + +if (isset($testsuite) && isset($testcase)) { + $graphName = $testsuite . '#' . $testcase; + $graphData = $graphs[$graphName]; + + // Create the graph. These two calls are always required + $graph = new Graph(650,250); + + //$graph->SetScale('intint'); + $graph->SetScale('textlin'); + $graph->yaxis->scale->SetAutoMin(0); + + $graph->title->Set($testsuite); + $graph->subtitle->Set($testcase); + + $graph->xaxis->title->Set('revision'); + $graph->yaxis->title->Set('seconds'); + $graph->SetMargin(100, 100, 50, 50); + + // Create the linear plot + $lineplot = new LinePlot($graphData); + $lineplot->SetColor('blue'); + + $graph->xaxis->SetTickLabels($revisions); + + // Add the plot to the graph + $graph->Add($lineplot); + + // Display the graph + $graph->Stroke(); +} else { + + echo ''; + echo 'Pick a test and click "show":
'; + echo '
'; + + echo ''; + + echo ''; + + echo '
'; + echo ''; + +} + + +