$db_data = API::Graph()->get(array('graphids' => $_REQUEST['graphid'], 'selectHosts' => API_OUTPUT_EXTEND, 'output' => API_OUTPUT_EXTEND)); if (empty($db_data)) { access_deny(); } else { $db_data = reset($db_data); } $host = reset($db_data['hosts']); /* * Display */ $timeline = CScreenBase::calculateTime(array('profileIdx' => get_request('profileIdx', 'web.screens'), 'profileIdx2' => get_request('profileIdx2'), 'updateProfile' => get_request('updateProfile', true), 'period' => get_request('period'), 'stime' => get_request('stime'))); $graph = new CPie($db_data['graphtype']); $graph->setPeriod($timeline['period']); $graph->setSTime($timeline['stime']); 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->setWidth($width); $graph->setHeight($height); $graph->setHeader($host['host'] . ': ' . $db_data['name']); if ($db_data['show_3d']) { $graph->switchPie3D(); }