$graph->setSTime($timeline['stime']); if (isset($_REQUEST['border'])) { $graph->setBorder(0); } $width = get_request('width', 0); if ($width <= 0) { $width = $dbGraph['width']; } $height = get_request('height', 0); if ($height <= 0) { $height = $dbGraph['height']; } $graph->showLegend($dbGraph['show_legend']); $graph->showWorkPeriod($dbGraph['show_work_period']); $graph->showTriggers($dbGraph['show_triggers']); $graph->setWidth($width); $graph->setHeight($height); $graph->setYMinAxisType($dbGraph['ymin_type']); $graph->setYMaxAxisType($dbGraph['ymax_type']); $graph->setYAxisMin($dbGraph['yaxismin']); $graph->setYAxisMax($dbGraph['yaxismax']); $graph->setYMinItemId($dbGraph['ymin_itemid']); $graph->setYMaxItemId($dbGraph['ymax_itemid']); $graph->setLeftPercentage($dbGraph['percent_left']); $graph->setRightPercentage($dbGraph['percent_right']); $dbGraphItems = DBselect('SELECT gi.*' . ' FROM graphs_items gi' . ' WHERE gi.graphid=' . zbx_dbstr($dbGraph['graphid']) . ' ORDER BY gi.sortorder,gi.itemid DESC'); while ($dbGraphItem = DBfetch($dbGraphItems)) { $graph->addItem($dbGraphItem['itemid'], $dbGraphItem['yaxisside'], $dbGraphItem['calc_fnc'], $dbGraphItem['color'], $dbGraphItem['drawtype'], $dbGraphItem['type']); } $graph->draw(); require_once dirname(__FILE__) . '/include/page_footer.php';
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); } $graph->draw();
$graph = new CLineGraphDraw(getRequest('type')); $graph->setPeriod($timeline['period']); $graph->setSTime($timeline['stime']); // change how the graph will be displayed if more than one item is selected if (getRequest('batch')) { // set a default header if (count($hostNames) == 1) { $graph->setHeader($hostNames[0] . NAME_DELIMITER . _('Item values')); } else { $graph->setHeader(_('Item values')); } // hide triggers $graph->showTriggers(false); } if (isset($_REQUEST['from'])) { $graph->setFrom($_REQUEST['from']); } if (isset($_REQUEST['width'])) { $graph->setWidth($_REQUEST['width']); } if (isset($_REQUEST['height'])) { $graph->setHeight($_REQUEST['height']); } if (isset($_REQUEST['border'])) { $graph->setBorder(0); } foreach ($items as $item) { $graph->addItem($item['itemid'], GRAPH_YAXIS_SIDE_DEFAULT, getRequest('batch') ? CALC_FNC_AVG : CALC_FNC_ALL, rgb2hex(get_next_color(1))); } $graph->draw(); require_once dirname(__FILE__) . '/include/page_footer.php';