예제 #1
0
 * Display
 */
if ($isDataValid) {
    navigation_bar_calc();
    $graph = new CPie(get_request('graphtype', GRAPH_TYPE_NORMAL));
    $graph->setHeader(get_request('name', ''));
    if (!empty($_REQUEST['graph3d'])) {
        $graph->switchPie3D();
    }
    $graph->showLegend(get_request('legend', 0));
    unset($host);
    if (isset($_REQUEST['period'])) {
        $graph->setPeriod($_REQUEST['period']);
    }
    if (isset($_REQUEST['from'])) {
        $graph->setFrom($_REQUEST['from']);
    }
    if (isset($_REQUEST['stime'])) {
        $graph->setSTime($_REQUEST['stime']);
    }
    if (isset($_REQUEST['border'])) {
        $graph->setBorder(0);
    }
    $graph->setWidth(get_request('width', 400));
    $graph->setHeight(get_request('height', 300));
    foreach ($items as $item) {
        $graph->addItem($item['itemid'], $item['calc_fnc'], $item['color'], $item['type']);
    }
    $graph->draw();
}
require_once dirname(__FILE__) . '/include/page_footer.php';