fixed bug to draw charts in custom reports

This commit is contained in:
alejandro-campos 2018-06-27 17:24:40 +02:00
parent f4ef0110b2
commit 25d252a8a4
1 changed files with 15 additions and 15 deletions

View File

@ -3880,19 +3880,6 @@ function reporting_value($report, $content, $type,$pdf) {
$only_image = 1; $only_image = 1;
} }
switch ($type) {
case 'max':
if($content['lapse_calc'] == 0){
$value = reporting_get_agentmodule_data_max(
$content['id_agent_module'], $content['period'], $report["datetime"]);
if (!$config['simple_module_value']) {
$formated_value = $value;
}
else {
$formated_value = format_for_graph($value, $config['graph_precision']) . " " . $unit;
}
}
else{
$params =array( $params =array(
'agent_module_id' => $content['id_agent_module'], 'agent_module_id' => $content['id_agent_module'],
'period' => $content['period'], 'period' => $content['period'],
@ -3907,6 +3894,20 @@ function reporting_value($report, $content, $type,$pdf) {
'server_id' => $id_meta 'server_id' => $id_meta
); );
switch ($type) {
case 'max':
if($content['lapse_calc'] == 0){
$value = reporting_get_agentmodule_data_max(
$content['id_agent_module'], $content['period'], $report["datetime"]);
if (!$config['simple_module_value']) {
$formated_value = $value;
}
else {
$formated_value = format_for_graph($value, $config['graph_precision']) . " " . $unit;
}
}
else{
$value = ' $value = '
<table border="0" style="margin:0 auto;text-align:center;"> <table border="0" style="margin:0 auto;text-align:center;">
<tr> <tr>
@ -4159,7 +4160,6 @@ function reporting_value($report, $content, $type,$pdf) {
<td rowspan="2" width="150px"> <td rowspan="2" width="150px">
</td> </td>
<td rowspan="2">'; <td rowspan="2">';
if($content['visual_format'] == 2 || $content['visual_format'] == 3){ if($content['visual_format'] == 2 || $content['visual_format'] == 3){
$params['force_interval'] = 'avg_only'; $params['force_interval'] = 'avg_only';
$value .= grafico_modulo_sparse($params); $value .= grafico_modulo_sparse($params);