$bplot = new BarPlot(array_values($values));
    if ($performer == "customer") {
        $color = "#99ccff";
    } else {
        $color = "#ffcc00";
    }
    $bplot->SetFillColor($color);
    $bplot->setLegend(ucfirst($performer) . " " . $event_type);
    $plots[] = $bplot;
}
$graph = new Graph(800, 350);
$graph->SetScale("textlin");
$graph->img->SetMargin(60, 30, 40, 40);
$graph->yaxis->SetTitleMargin(45);
$graph->SetShadow();
// Turn the tickmarks
$graph->xaxis->SetTickDirection(SIDE_DOWN);
$graph->yaxis->SetTickDirection(SIDE_LEFT);
$graph->xaxis->SetTickLabels(array_keys($data["developer"] + $data["customer"]));
// group plots together
$grouped = new GroupBarPlot($plots);
$graph->Add($grouped);
$graph->title->Set($graph_title);
$graph->xaxis->title->Set("Hours (" . Date_API::getTimezoneShortNameByUser($usr_id) . ")");
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->title->Set(ucfirst($event_type) . " (%)");
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->legend->Pos(0.01, 0.09, 'left', 'bottom');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->Stroke();
// | Boston, MA 02111-1307, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: Bryan Alsdorf <*****@*****.**>                             |
// +----------------------------------------------------------------------+
//
// @(#) $Id$
//
include_once "../config.inc.php";
include_once APP_INC_PATH . "class.template.php";
include_once APP_INC_PATH . "class.auth.php";
include_once APP_INC_PATH . "class.report.php";
include_once APP_INC_PATH . "class.date.php";
include_once APP_INC_PATH . "db_access.php";
$tpl = new Template_API();
$tpl->setTemplate("reports/workload_time_period.tpl.html");
Auth::checkAuthentication(APP_COOKIE);
$usr_id = Auth::getUserID();
if (Auth::getCurrentRole() <= User::getRoleID("Customer")) {
    echo "Invalid role";
    exit;
}
$prj_id = Auth::getCurrentProject();
// get timezone of current user
$user_prefs = Prefs::get($usr_id);
if (@$HTTP_GET_VARS["type"] == "email") {
    $data = Report::getEmailWorkloadByTimePeriod(@$user_prefs["timezone"]);
} else {
    $data = Report::getWorkloadByTimePeriod(@$user_prefs["timezone"]);
}
$tpl->assign(array("data" => $data, "type" => @$HTTP_GET_VARS["type"], "user_tz" => Date_API::getTimezoneShortNameByUser($usr_id)));
$tpl->displayTemplate();