コード例 #1
0
    echo $report->getErrorMessage();
    exit;
}
// XXX ogi: Isn't it $type?
if (!isset($datatype)) {
    $datatype = 1;
}
if (!$start) {
    $start = mktime(0, 0, 0, date('m'), 1, date('Y'));
}
if (!$end) {
    $end = time();
} else {
    $end--;
}
// Create the graph. These two calls are always required
$graph = new PieGraph(640, 480, "auto");
//$graph->SetMargin(50,10,35,50);
$arr['tasks'] = 'By Task';
$arr['category'] = 'By Category';
$arr['subproject'] = 'By Subproject';
$arr['user'] = '******';
$graph->title->Set("Time Report " . $arr[$type] . " (" . date('m/d/Y', $start) . "-" . date('m/d/Y', $end) . ")");
$graph->subtitle->Set($sys_name);
report_pie_arr($report->labels, $report->getData());
$p1 = new PiePlot3D($pie_vals);
$p1->ExplodeSlice(0);
$p1->SetLegends($pie_labels);
$graph->Add($p1);
// Display the graph
$graph->Stroke();
コード例 #2
0
    $datatype = 1;
}
if (!$start) {
    $start = time() - $days * 60 * 60 * 24;
    $formattedmonth = date('Ym', $start);
}
if (!$end) {
    $end = time();
} else {
    $end--;
}
$sql = "SELECT u.realname,sum(commits) AS count \n\t\tFROM stats_cvs_user scu, users u\n\t\tWHERE u.user_id=scu.user_id \n\t\tAND scu.month >= '{$formattedmonth}'\n\t\tAND group_id='{$group_id}'\n\t\tGROUP BY realname ORDER BY count DESC";
//echo $sql;
//exit;
$res = db_query($sql);
if (db_error()) {
    exit_error('Error', db_error());
}
// Create the graph. These two calls are always required
$graph = new PieGraph(640, 480, "auto");
//$graph->SetMargin(50,10,35,50);
$graph->title->Set("Commits By User (" . date('m/d/Y', $start) . "-" . date('m/d/Y', $end) . ")");
$graph->subtitle->Set($sys_name);
// Create the tracker open plot
report_pie_arr(util_result_column_to_array($res, 0), util_result_column_to_array($res, 1));
$p1 = new PiePlot3D($pie_vals);
$p1->ExplodeSlice(0);
$p1->SetLegends($pie_labels);
$graph->Add($p1);
// Display the graph
$graph->Stroke();