diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 812e729502..40e5a2b658 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -271,17 +271,35 @@ function grafico_modulo_sparse_data_chart ( ); } else{ - $data = db_get_all_rows_filter ( - 'tagente_datos', - array ('id_agente_modulo' => (int)$agent_module_id, - "utimestamp > '". $date_array['start_date']. "'", - "utimestamp < '". $date_array['final_date'] . "'", - 'group' => "ROUND(utimestamp / $data_slice)", - 'order' => 'utimestamp ASC'), - array ('sum(datos)/count(datos) as datos', 'min(utimestamp) as utimestamp'), - 'AND', - $data_module_graph['history_db'] - ); + if($data_module_graph['id_module_type'] == 2 || + $data_module_graph['id_module_type'] == 6 || + $data_module_graph['id_module_type'] == 18 || + $data_module_graph['id_module_type'] == 9){ + $data = db_get_all_rows_filter ( + 'tagente_datos', + array ('id_agente_modulo' => (int)$agent_module_id, + "utimestamp > '". $date_array['start_date']. "'", + "utimestamp < '". $date_array['final_date'] . "'", + 'group' => "ROUND(utimestamp / $data_slice)", + 'order' => 'utimestamp ASC'), + array ('ROUND(sum(datos)/count(datos)) as datos', 'min(utimestamp) as utimestamp'), + 'AND', + $data_module_graph['history_db'] + ); + } + else{ + $data = db_get_all_rows_filter ( + 'tagente_datos', + array ('id_agente_modulo' => (int)$agent_module_id, + "utimestamp > '". $date_array['start_date']. "'", + "utimestamp < '". $date_array['final_date'] . "'", + 'group' => "ROUND(utimestamp / $data_slice)", + 'order' => 'utimestamp ASC'), + array ('sum(datos)/count(datos) as datos', 'min(utimestamp) as utimestamp'), + 'AND', + $data_module_graph['history_db'] + ); + } } }