Ejemplo n.º 1
0
if (isset($_REQUEST['border'])) {
    $graph->setBorder(0);
}
$width = get_request('width', 0);
if ($width <= 0) {
    $width = $db_data['width'];
}
$height = get_request('height', 0);
if ($height <= 0) {
    $height = $db_data['height'];
}
//	$graph->showLegend($db_data['show_legend']);
$graph->showWorkPeriod($db_data['show_work_period']);
$graph->showTriggers($db_data['show_triggers']);
$graph->setWidth($width);
$graph->setHeight($height);
$graph->setYMinAxisType($db_data['ymin_type']);
$graph->setYMaxAxisType($db_data['ymax_type']);
$graph->setYAxisMin($db_data['yaxismin']);
$graph->setYAxisMax($db_data['yaxismax']);
$graph->setYMinItemId($db_data['ymin_itemid']);
$graph->setYMaxItemId($db_data['ymax_itemid']);
$graph->setLeftPercentage($db_data['percent_left']);
$graph->setRightPercentage($db_data['percent_right']);
$sql = 'SELECT gi.* ' . ' FROM graphs_items gi ' . ' WHERE gi.graphid=' . $db_data['graphid'] . ' ORDER BY gi.sortorder, gi.itemid DESC';
$result = DBselect($sql);
while ($db_data = DBfetch($result)) {
    $graph->addItem($db_data['itemid'], $db_data['yaxisside'], $db_data['calc_fnc'], $db_data['color'], $db_data['drawtype'], $db_data['type'], $db_data['periods_cnt']);
}
$graph->draw();
include_once 'include/page_footer.php';
Ejemplo n.º 2
0
    $name = get_request('name', '');
}
/*
 * Display
 */
if ($isDataValid) {
    $graph = new CChart(get_request('graphtype', GRAPH_TYPE_NORMAL));
    $graph->setHeader($name);
    navigation_bar_calc();
    $graph->setPeriod($_REQUEST['period']);
    $graph->setSTime($_REQUEST['stime']);
    $graph->setWidth(get_request('width', 900));
    $graph->setHeight(get_request('height', 200));
    $graph->showLegend(get_request('legend', 1));
    $graph->showWorkPeriod(get_request('showworkperiod', 1));
    $graph->showTriggers(get_request('showtriggers', 1));
    $graph->setYMinAxisType(get_request('ymin_type', GRAPH_YAXIS_TYPE_CALCULATED));
    $graph->setYMaxAxisType(get_request('ymax_type', GRAPH_YAXIS_TYPE_CALCULATED));
    $graph->setYAxisMin(get_request('yaxismin', 0.0));
    $graph->setYAxisMax(get_request('yaxismax', 100.0));
    $graph->setYMinItemId(get_request('ymin_itemid', 0));
    $graph->setYMaxItemId(get_request('ymax_itemid', 0));
    $graph->setLeftPercentage(get_request('percent_left', 0));
    $graph->setRightPercentage(get_request('percent_right', 0));
    foreach ($items as $inum => $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, isset($item['type']) ? $item['type'] : null);
        unset($items[$inum]);
    }
    $graph->draw();
}
require_once dirname(__FILE__) . '/include/page_footer.php';
Ejemplo n.º 3
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=' . $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';