require_once dirname(__FILE__).'/include/config.inc.php';
require_once dirname(__FILE__).'/include/services.inc.php';
$page['file'] = 'chart5.php';
$page['type'] = PAGE_TYPE_IMAGE;
require_once dirname(__FILE__).'/include/page_header.php';
'serviceid' => [T_ZBX_INT, O_MAND, P_SYS, DB_ID, null]
if (!check_fields($fields)) {
$service = API::Service()->get([
'output' => ['serviceid', 'name'],
'serviceids' => $_REQUEST['serviceid']
$service = reset($service);
$debug_mode = CWebUser::getDebugMode();
$start_time = microtime(true);
$shiftYdown = 25 + 15 * 3;
if (function_exists('imagecolorexactalpha') && function_exists('imagecreatetruecolor') && @imagecreatetruecolor(1, 1)) {
$im = imagecreatetruecolor($sizeX + $shiftX + 61, $sizeY + $shiftYup + $shiftYdown + 10);
$im = imagecreate($sizeX + $shiftX + 61, $sizeY + $shiftYup + $shiftYdown + 10);
$graphtheme = getUserGraphTheme();
$black = get_color($im, '000000');
$green = get_color($im, '34AF67');
$red = get_color($im, 'D64E4E');
$grey = get_color($im, '969696', 50);
$backgroundcolor = get_color($im, $graphtheme['backgroundcolor']);
$gridcolor = get_color($im, $graphtheme['gridcolor']);
$textcolor = get_color($im, $graphtheme['textcolor']);
$highlightcolor = get_color($im, $graphtheme['highlightcolor']);
imagefilledrectangle($im, 0, 0, $x, $y, $backgroundcolor);
$d = zbx_date2str(_x('Y', DATE_FORMAT_CONTEXT));
$str = _s('%1$s (year %2$s)', $service['name'], $d);
$x = imagesx($im) / 2 - imagefontwidth(4) * mb_strlen($str) / 2;
imageText($im, 10, 0, $x, 14, $textcolor, $str);