Ejemplo n.º 1
0
    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();
require_once dirname(__FILE__) . '/include/page_footer.php';
Ejemplo n.º 2
0
$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';