Example #1
0
    	  exit;*/
    // In case there is no data set or just 1 record then
    // simulate 2 records. otherwise it Graph_lib crashes
    $xdata[$i] = $i;
    $xlabel[$i] = $month . "-" . $day;
    $ydata1[$i] = 0;
    $ydata2[$i] = 0;
    $i = 1;
    $xdata[$i] = $i;
    $xlabel[$i] = $month . "-" . $day + 1;
    $ydata1[$i] = 0;
    $ydata2[$i] = 0;
    $i = 2;
}
$graph = new Graph(600, 350);
$graph->addDebug("We appended {$i} rows of data to the graphing set.");
$graph->addDebug("{$begin_time}");
$graph->addDebug("{$sql}");
$data1 = $graph->AddData($xdata, $ydata1, $xlabel);
$data2 = $graph->AddData($xdata, $ydata2, $xlabel);
$graph->DrawGrid('gray');
$graph->LineGraph($data1, 'red');
$graph->LineGraph($data2, 'blue');
$pm = ProjectManager::instance();
$graph->SetTitle("Codendi Statistics: " . util_unconvert_htmlspecialchars($pm->getProject($group_id)->getPublicName()));
$graph->SetSubTitle("Page Views (red) and Downloads (blue) for the past {$i} days");
$graph->SetxTitle('Date');
$graph->SetyTitle('Views (red) / Downloads (blue)');
$graph->DrawAxis();
//$graph->showDebug();
// If PHP3 then assume GD library < 1.6 with only GIF Support