';
$output .= ''.$title.'';
$labels = array_keys($data);
$options = [
'width' => 320,
'height' => 200,
'waterMark' => $water_mark,
'legend' => [
'display' => true,
'position' => 'right',
'align' => 'center',
],
'labels' => $labels,
];
$output .= '
';
$output .= pie_graph(
array_values($data),
$options
);
$output .= '
';
$output .= '';
return $output;
}
// Header tabs.
ui_print_standard_header(
__('ITSM Dashboard'),
'',
false,
'ITSM_tab',
false,
$headerTabs,
[
[
'link' => 'index.php?sec=ITSM&sec2=operation/ITSM/itsm',
'label' => __('ITSM'),
],
[
'link' => 'index.php?sec=ITSM&sec2=operation/ITSM/itsm',
'label' => __('ITSM Dashboard'),
],
]
);
if (empty($error) === false) {
ui_print_error_message($error);
}
if (empty($incidencesByStatus) === true) {
ui_print_info_message(
[
'no_close' => true,
'message' => __('Not found incidences'),
]
);
} else {
$output = '';
$output .= draw_graph(__('Incidents by status'), $incidencesByStatus);
$output .= draw_graph(__('Incidents by priority'), $incidencesByPriorities);
$output .= draw_graph(__('Incidents by group'), $incidencesByGroups);
$output .= draw_graph(__('Incidents by user'), $incidencesByOwners);
$output .= '
';
echo $output;
}