Fixed max_value report

This commit is contained in:
danielmaya 2018-09-18 12:18:47 +02:00
parent 921a025262
commit 6cf638a4d8
2 changed files with 184 additions and 182 deletions

View File

@ -513,6 +513,8 @@ function grafico_modulo_sparse_data(
}
$period_time_interval = $period_time_interval - $params['time_interval'];
}
//drag the last value to paint the graph correctly
$acum_array_data[]= array( 0 => $start_period, 1 => $acum_array_data[$i-1][1]);
$array_data['sum1']['data'] = $acum_array_data;
}

View File

@ -3816,7 +3816,8 @@ function reporting_value($report, $content, $type,$pdf) {
'type_graph' => $config['type_module_charts'],
'time_interval' => $content['lapse'],
'server_id' => $id_meta,
'height' => $config['graph_image_height']
'height' => $config['graph_image_height'],
'fullscale' => true
);
switch ($type) {
@ -3896,18 +3897,17 @@ function reporting_value($report, $content, $type,$pdf) {
</th>
</tr>
<tr>';
$time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']);
$time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module'], true);
$date_reference = getdate();
for ($i=$date_reference[0]; $i > ($date_reference[0]-$content["period"]); $i -= $content["lapse"]) {
$value .= '<tr><td style="padding:5px;">'. date("Y-m-d H:i:s", ($i-$content["lapse"]+1)).' to '.date("Y-m-d H:i:s",$i).'</td><td>';
if($i>$time_begin['utimestamp']){
if ($i>$time_begin['utimestamp']) {
$value .= format_for_graph(reporting_get_agentmodule_data_max(
$content['id_agent_module'], $content["lapse"], $i), $config['graph_precision']) . ' ' . $unit.'</td></tr>';
}
else{
} else {
$value .= 'N/A</td></tr>';
}