Esempio n. 1
0
    $name = getRequest('name', '');
} else {
    show_error_message(_('No items defined.'));
    exit;
}
/*
 * Display
 */
$profileIdx = getRequest('profileIdx', 'web.httptest');
$profileIdx2 = getRequest('httptestid', getRequest('profileIdx2'));
$timeline = CScreenBase::calculateTime(array('profileIdx' => $profileIdx, 'profileIdx2' => $profileIdx2, 'period' => getRequest('period'), 'stime' => getRequest('stime')));
CProfile::update($profileIdx . '.httptestid', $profileIdx2, PROFILE_TYPE_ID);
$graph = new CLineGraphDraw(getRequest('graphtype', GRAPH_TYPE_NORMAL));
$graph->setHeader($name);
$graph->setPeriod($timeline['period']);
$graph->setSTime($timeline['stime']);
$graph->setWidth(getRequest('width', 900));
$graph->setHeight(getRequest('height', 200));
$graph->showLegend(getRequest('legend', 1));
$graph->showWorkPeriod(getRequest('showworkperiod', 1));
$graph->showTriggers(getRequest('showtriggers', 1));
$graph->setYMinAxisType(getRequest('ymin_type', GRAPH_YAXIS_TYPE_CALCULATED));
$graph->setYMaxAxisType(getRequest('ymax_type', GRAPH_YAXIS_TYPE_CALCULATED));
$graph->setYAxisMin(getRequest('yaxismin', 0.0));
$graph->setYAxisMax(getRequest('yaxismax', 100.0));
$graph->setYMinItemId(getRequest('ymin_itemid', 0));
$graph->setYMaxItemId(getRequest('ymax_itemid', 0));
$graph->setLeftPercentage(getRequest('percent_left', 0));
$graph->setRightPercentage(getRequest('percent_right', 0));
foreach ($items as $item) {
    $graph->addItem($item['itemid'], isset($item['yaxisside']) ? $item['yaxisside'] : null, isset($item['calc_fnc']) ? $item['calc_fnc'] : null, isset($item['color']) ? $item['color'] : null, isset($item['drawtype']) ? $item['drawtype'] : null);