Exemple #1
0
 * Display
 */
if ($isDataValid) {
    navigation_bar_calc();
    $graph = new CPieGraphDraw(getRequest('graphtype', GRAPH_TYPE_NORMAL));
    $graph->setHeader(getRequest('name', ''));
    if (!empty($_REQUEST['graph3d'])) {
        $graph->switchPie3D();
    }
    $graph->showLegend(getRequest('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(getRequest('width', 400));
    $graph->setHeight(getRequest('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';