fixed graphs

This commit is contained in:
daniel 2018-05-30 17:45:17 +02:00
parent dd57ddbd3c
commit a8b8f309e6
10 changed files with 220 additions and 273 deletions

View File

@ -251,20 +251,29 @@ switch ($action) {
continue; continue;
} }
} }
if ($id_custom_graph != 0) { if ($id_custom_graph != 0) {
$img = custom_graphs_print( $img = custom_graphs_print(
$id_custom_graph, $height, $width, $period, $id_custom_graph, $height, $width, $period,
null, true, 0, true, $background_color); null, true, 0, true, $background_color);
} }
else { else {
$img = grafico_modulo_sparse($id_agent_module, $params =array(
$period, 0, $width, $height, '', null, false, 1, 'agent_module_id' => $id_agent_module,
0, 0, '', 0, 0, true, true, '', 1, false, '', 'period' => $period,
false, false, true, $background_color, 'show_events' => false,
false, false, false, $config['type_module_charts']); 'width' => $width,
'height' => $height,
//'only_image' => true,
//'homeurl' => '',
'menu' => false,
'backgroundColor' => $background_color,
'vconsole' => true,
'type_graph' => $config['type_module_charts']
);
$img = grafico_modulo_sparse($params);
} }
//Restore db connection //Restore db connection
if (!empty($id_metaconsole)) { if (!empty($id_metaconsole)) {
metaconsole_restore_db(); metaconsole_restore_db();

View File

@ -3104,6 +3104,10 @@ function series_type_graph_array($data, $show_elements_graph){
) . ' ' . $series_suffix_str; ) . ' ' . $series_suffix_str;
} }
} }
elseif(strpos($key, 'projection') !== false){
$data_return['series_type'][$key] = 'area';
$data_return['legend'][$key] = __('Projection') . ' ' . $series_suffix_str;
}
else{ else{
$data_return['series_type'][$key] = 'area'; $data_return['series_type'][$key] = 'area';
} }
@ -3116,15 +3120,23 @@ function series_type_graph_array($data, $show_elements_graph){
function generator_chart_to_pdf($params){ function generator_chart_to_pdf($params){
global $config; global $config;
$params_encode_json = urlencode(json_encode($params)); $params_encode_json = urlencode(json_encode($params));
$file_js = "/var/www/html/pandora_console/include/web2image.js"; $file_js = $config["homedir"] . "/include/web2image.js";
$url = "http://localhost/pandora_console/include/chart_generator.php"; $url = $config["homeurl"] . "/include/chart_generator.php";
$img_destination = "/var/www/html/pandora_console/attachment/imagen_". $params['agent_module_id'] .".png";
$width_img = 1048; $img_file = "img_". uniqid() . $params['agent_module_id'] .".png";
$height_img = 568; $img_path = $config["homedir"] . "/attachment/" . $img_file;
html_debug_print("entra con: " . $params['agent_module_id'] ." en el tiempo " . date("Y-m-d H:i:s"), true); $img_url = $config["homeurl"] . "/attachment/" . $img_file;
exec("phantomjs " . $file_js . " " . $url . " '" . $params_encode_json . "' " . $img_destination . " " . $width_img . " " . $height_img);
html_debug_print("sale con: " . $params['agent_module_id'] ." en el tiempo " . date("Y-m-d H:i:s"), true); error_log($img_url);
return "<img src='/var/www/html/pandora_console/attachment/imagen_". $params['agent_module_id'] .".png' alt='la imagen bonica'>";
$width_img = 500;
$height_img = 450;
//html_debug_print('entrando en llamada a phantom.js.......', true);
$result = exec("phantomjs " . $file_js . " " . $url . " '" . $params_encode_json . "' " . $img_path . " " . $width_img . " " . $height_img);
return '<img src="' . $img_url . '" />';
//header('Content-Type: image/png;');
//return '<img src="data:image/jpg;base64, '.$result.'" />';
//return "<img src='/var/www/html/pandora_console/attachment/imagen_". $params['agent_module_id'] .".png' alt='la imagen bonica'>";
} }
/** /**

View File

@ -10041,25 +10041,13 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4) {
// returnError('error_module_graph', __('')); // returnError('error_module_graph', __(''));
return; return;
} }
$id_module_type = modules_get_agentmodule_type ($id_module); $graph_html = grafico_modulo_sparse(
$module_type = modules_get_moduletype_name ($id_module_type); $id_module, $graph_seconds, false, 600, 300, '',
'', false, false, true, time(), '', 0, 0, true, true,
$string_type = strpos($module_type,'string'); ui_get_full_url(false) . '/', 1, false, '', false, true,
// Get the html item true, 'white', null, false, false, $config['type_module_charts'],
if ($string_type === false) { false, false);
$graph_html = grafico_modulo_sparse(
$id_module, $graph_seconds, false, 600, 300, '',
'', false, false, true, time(), '', 0, 0, true, true,
ui_get_full_url(false) . '/', 1, false, '', false, true,
true, 'white', null, false, false, $config['type_module_charts'],
false, false);
} else {
$graph_html = grafico_modulo_string(
$id_module, $graph_seconds, false, 600, 300, '',
'', false, false, true, time(), true, ui_get_full_url(false) . '/',
'', 1, true);
}
$graph_image_file_encoded = false; $graph_image_file_encoded = false;
if (preg_match("/<img src='(.+)'./", $graph_html, $matches)) { if (preg_match("/<img src='(.+)'./", $graph_html, $matches)) {

View File

@ -46,12 +46,15 @@ function forecast_projection_graph($module_id,
} }
$begin_time = time(); $begin_time = time();
$module_data=grafico_modulo_sparse ($module_id, $period, 0, $params =array(
300, 300 , '', null, 'agent_module_id' => $module_id,
false, 0, false, 'period' => $period,
0, '', 0, 1, false, 'return_data' => 1,
true, '', 1, true); 'projection' => true
);
$module_data = grafico_modulo_sparse ($params);
if (empty($module_data)) { if (empty($module_data)) {
return array(); return array();
@ -62,55 +65,57 @@ function forecast_projection_graph($module_id,
} }
// Data initialization // Data initialization
$sum_obs = 0; $sum_obs = 0;
$sum_xi = 0; $sum_xi = 0;
$sum_yi = 0; $sum_yi = 0;
$sum_xi_yi = 0; $sum_xi_yi = 0;
$sum_xi2 = 0; $sum_xi2 = 0;
$sum_yi2 = 0; $sum_yi2 = 0;
$sum_diff_dates = 0; $sum_diff_dates = 0;
$last_timestamp = get_system_time(); $last_timestamp = get_system_time();
$agent_interval = SECONDS_5MINUTES; $agent_interval = SECONDS_5MINUTES;
$cont = 1; $cont = 1;
$data = array(); $data = array();
//$table->data = array(); //$table->data = array();
// Creates data for calculation // Creates data for calculation
if (is_array($module_data) || is_object($module_data)) { if (is_array($module_data) || is_object($module_data)) {
foreach ($module_data as $utimestamp => $row) { foreach ($module_data['sum1']['data'] as $key => $row) {
if ($utimestamp == '') { if ($row[0] == '') {
continue; continue;
} }
$row[0] = $row[0] / 1000;
$data[0] = ''; $data[0] = '';
$data[1] = $cont; $data[1] = $cont;
$data[2] = date($config["date_format"], $utimestamp); $data[2] = date($config["date_format"], $row[0]);
$data[3] = $utimestamp; $data[3] = $row[0];
$data[4] = $row['sum']; $data[4] = $row[1];
$data[5] = $utimestamp * $row['sum']; $data[5] = $row[0] * $row[1];
$data[6] = $utimestamp * $utimestamp; $data[6] = $row[0] * $row[0];
$data[7] = $row['sum'] * $row['sum']; $data[7] = $row[1] * $row[1];
if ($cont == 1) { if ($cont == 1) {
$data[8] = 0; $data[8] = 0;
} }
else { else {
$data[8] = $utimestamp - $last_timestamp; $data[8] = $row[0] - $last_timestamp;
} }
$sum_obs = $sum_obs + $cont; $sum_obs = $sum_obs + $cont;
$sum_xi = $sum_xi + $utimestamp; $sum_xi = $sum_xi + $row[0];
$sum_yi = $sum_yi + $row['sum']; $sum_yi = $sum_yi + $row[1];
$sum_xi_yi = $sum_xi_yi + $data[5]; $sum_xi_yi = $sum_xi_yi + $data[5];
$sum_xi2 = $sum_xi2 + $data[6]; $sum_xi2 = $sum_xi2 + $data[6];
$sum_yi2 = $sum_yi2 + $data[7]; $sum_yi2 = $sum_yi2 + $data[7];
$sum_diff_dates = $sum_diff_dates + $data[8]; $sum_diff_dates = $sum_diff_dates + $data[8];
$last_timestamp = $utimestamp; $last_timestamp = $row[0];
$cont++; $cont++;
} }
} }
$cont--; $cont--;
// Calculation over data above: // Calculation over data above:
// 1. Calculation of linear correlation coefficient... // 1. Calculation of linear correlation coefficient...
@ -121,15 +126,6 @@ function forecast_projection_graph($module_id,
// 3.2 Standard deviation for Y: sqrt((Sum(Yi²)/Obs) - (avg Y)²) // 3.2 Standard deviation for Y: sqrt((Sum(Yi²)/Obs) - (avg Y)²)
// Linear correlation coefficient: // Linear correlation coefficient:
if ($sum_xi != 0) {
$avg_x = $cont/$sum_xi;
} else {
$avg_x = 0;
}
if ($sum_yi != 0)
$avg_y = $cont/$sum_yi;
else
$avg_y = 0;
/* /*
if ($cont != 0) { if ($cont != 0) {
@ -229,18 +225,17 @@ function forecast_projection_graph($module_id,
} }
} }
$timestamp_f = date($time_format, $current_ts); $timestamp_f = $current_ts * 1000;
//$timestamp_f = date($time_format, $current_ts);
$timestamp_f = graph_get_formatted_date($current_ts, $time_format, $time_format_2);
if ($csv) { if ($csv) {
$output_data[$idx]['date'] = $current_ts; $output_data[$idx]['date'] = $current_ts;
$output_data[$idx]['data'] = ($a + ($b * $current_ts)); $output_data[$idx]['data'] = ($a + ($b * $current_ts));
} }
else { else {
$output_data[$timestamp_f] = ($a + ($b * $current_ts)); $output_data[$idx][0] = $timestamp_f;
$output_data[$idx][1] = ($a + ($b * $current_ts));
} }
// Using this function for prediction_date // Using this function for prediction_date
if ($prediction_period == false) { if ($prediction_period == false) {
// These statements stop the prediction when interval is greater than 2 years // These statements stop the prediction when interval is greater than 2 years
@ -249,7 +244,7 @@ function forecast_projection_graph($module_id,
} }
// Found it // Found it
if ($max_value >= $output_data[$timestamp_f] and $min_value <= $output_data[$timestamp_f]) { if ($max_value >= $output_data[$idx][0] and $min_value <= $output_data[$idx][0]) {
return $current_ts; return $current_ts;
} }
} }
@ -259,7 +254,7 @@ function forecast_projection_graph($module_id,
$current_ts = $current_ts + $agent_interval; $current_ts = $current_ts + $agent_interval;
$idx++; $idx++;
} }
return $output_data; return $output_data;
} }

View File

@ -234,16 +234,45 @@ function grafico_modulo_sparse_data_chart (
global $config; global $config;
$data = db_get_all_rows_filter ( if( $data_module_graph['id_module_type'] == 23 ||
'tagente_datos', $data_module_graph['id_module_type'] == 3 ||
array ('id_agente_modulo' => (int)$agent_module_id, $data_module_graph['id_module_type'] == 17 ||
"utimestamp > '". $date_array['start_date']. "'", $data_module_graph['id_module_type'] == 10 ||
"utimestamp < '". $date_array['final_date'] . "'", $data_module_graph['id_module_type'] == 33 ){
'order' => 'utimestamp ASC'),
array ('datos', 'utimestamp'), //XXXXXXXXXXX
'AND', /*
$data_module_graph['history_db'] "SELECT count(*) as data, min(utimestamp) as utimestamp
); FROM tagente_datos_string
WHERE id_agente_modulo = 227
AND utimestamp > 1527584831
AND utimestamp < 1527671231
GROUP by ROUND(utimestamp / 300);"
*/
$data = db_get_all_rows_filter (
'tagente_datos_string',
array ('id_agente_modulo' => (int)$agent_module_id,
"utimestamp > '". $date_array['start_date']. "'",
"utimestamp < '". $date_array['final_date'] . "'",
'group' => "ROUND(utimestamp / 300)",
'order' => 'utimestamp ASC'),
array ('count(*) 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'] . "'",
'order' => 'utimestamp ASC'),
array ('datos', 'utimestamp'),
'AND',
$data_module_graph['history_db']
);
}
if($data === false){ if($data === false){
$data = array(); $data = array();
@ -665,7 +694,6 @@ function grafico_modulo_sparse_data(
); );
*/ */
function grafico_modulo_sparse ($params) { function grafico_modulo_sparse ($params) {
html_debug_print('entra por este sitio', true);
global $config; global $config;
/*XXXXXXXXXXXX Documnetar /*XXXXXXXXXXXX Documnetar
@ -691,8 +719,6 @@ function grafico_modulo_sparse ($params) {
$params['show_events'] = false; $params['show_events'] = false;
} }
// ATTENTION: The min size is in constants.php
// It's not the same minsize for all graphs, but we are choosed a prudent minsize for all
if(!isset($params['width'])){ if(!isset($params['width'])){
$params['width'] = '90%'; $params['width'] = '90%';
} }
@ -821,7 +847,7 @@ function grafico_modulo_sparse ($params) {
//XXXXXXXXXXXX se devuelve phantom.js //XXXXXXXXXXXX se devuelve phantom.js
if($params['only_image']){ if($params['only_image']){
return generator_chart_to_pdf($params); return generator_chart_to_pdf($params);
} }
global $graphic_type; global $graphic_type;
@ -1251,6 +1277,10 @@ function graphic_combined_module (
$i++; $i++;
} }
if($projection && is_array($projection)){
$array_data['projection']['data']= $projection;
}
//summatory and average series //summatory and average series
if($stacked == CUSTOM_GRAPH_AREA || $stacked == CUSTOM_GRAPH_LINE) { if($stacked == CUSTOM_GRAPH_AREA || $stacked == CUSTOM_GRAPH_LINE) {
if($summatory || $average) { if($summatory || $average) {

View File

@ -6478,10 +6478,6 @@ function reporting_simple_graph($report, $content, $type = 'dinamic',
$fullscale = (bool) $content['style']['fullscale']; $fullscale = (bool) $content['style']['fullscale'];
} }
$moduletype_name = modules_get_moduletype_name(
modules_get_agentmodule_type(
$content['id_agent_module']));
$return['chart'] = ''; $return['chart'] = '';
// Get chart // Get chart
@ -6498,54 +6494,30 @@ function reporting_simple_graph($report, $content, $type = 'dinamic',
switch ($type) { switch ($type) {
case 'dinamic': case 'dinamic':
case 'static': case 'static':
if (preg_match ("/string/", $moduletype_name)) { // HACK it is saved in show_graph field.
$urlImage = ui_get_full_url(false, false, false, false); $time_compare_overlapped = false;
/* if ($content['show_graph']) {
$return['chart'] = grafico_modulo_string( $time_compare_overlapped = 'overlapped';
$content['id_agent_module'],
$content['period'],
false,
$width,
$height,
$label,
'',
false,
$only_avg,
false,
$report["datetime"],
$only_image,
$urlImage,
"",
$ttl);
*/
$return['chart'] = 'arreglar la grafica de string de una vez por todassssssssss';
} }
else {
// HACK it is saved in show_graph field.
$time_compare_overlapped = false;
if ($content['show_graph']) {
$time_compare_overlapped = 'overlapped';
}
$params =array( $params =array(
'agent_module_id' => $content['id_agent_module'], 'agent_module_id' => $content['id_agent_module'],
'period' => $content['period'], 'period' => $content['period'],
'title' => $label, 'title' => $label,
'avg_only' => $only_avg, 'avg_only' => $only_avg,
'pure' => false, //XXX 'pure' => false, //XXX
'date' => $report["datetime"], 'date' => $report["datetime"],
'only_image' => $only_image, 'only_image' => $only_image,
'homeurl' => ui_get_full_url(false, false, false, false), 'homeurl' => ui_get_full_url(false, false, false, false),
'ttl' => $ttl, 'ttl' => $ttl,
'compare' => $time_compare_overlapped, 'compare' => $time_compare_overlapped,
'show_unknown' => true, 'show_unknown' => true,
'percentil' => ($content['style']['percentil'] == 1) ? $config['percentil'] : null, 'percentil' => ($content['style']['percentil'] == 1) ? $config['percentil'] : null,
'fullscale' => $fullscale 'fullscale' => $fullscale
); );
$return['chart'] = grafico_modulo_sparse($params);
$return['chart'] = grafico_modulo_sparse($params);
}
break; break;
case 'data': case 'data':
$data = modules_get_agentmodule_data( $data = modules_get_agentmodule_data(

View File

@ -1034,85 +1034,61 @@ function visual_map_print_item($mode = "read", $layoutData,
else{ else{
$img = '<img src="images/console/signes/module_graph.png" style="width:'.$width.'px;height:'. $height.'px;'.$imgpos.'">'; $img = '<img src="images/console/signes/module_graph.png" style="width:'.$width.'px;height:'. $height.'px;'.$imgpos.'">';
} }
}
}
else {
if ($width == 0 || $height == 0) {
if ($layoutData['label_position']=='left') {
$img = '<div style="z-index:'.$show_on_top_index.';float:right;height:'.$himg.'px;">'.
grafico_modulo_sparse($id_module, $period,
0, 300, 180, modules_get_agentmodule_name($id_module),null, false, 1, false, 0,
modules_get_unit($id_module), 0, 0, true, $only_image, '', 1, false, '',
false, false, false, $layoutData['image'],
null, true, false, $type_graph) . '</div>';
}
elseif($layoutData['label_position']=='right') {
$img = '<div style="z-index:'.$show_on_top_index.';float:left;height:'.$himg.'px;">' .
grafico_modulo_sparse($id_module,
$period, 0, 300, 180, modules_get_agentmodule_name($id_module),null, false,
1, false, 0, modules_get_unit($id_module), 0, 0, true, $only_image, '',
1, false, '', false, false, false,
$layoutData['image'], null, true,
false, $type_graph) . '</div>';
}
else {
$img = grafico_modulo_sparse($id_module,
$period, 0, 300, 180, modules_get_agentmodule_name($id_module),null, false, 1,
false, 0, modules_get_unit($id_module), 0, 0, true, $only_image, '',
1, false, '', false, false, false,
$layoutData['image'], null, true, false, $type_graph);
}
}
else{
if ($layoutData['label_position']=='left') {
$img = '<div style="z-index:'.$show_on_top_index.';float:right;height:'.$himg.'px;">' .
grafico_modulo_sparse($id_module, $period,
0, $width, $height, modules_get_agentmodule_name($id_module), null, false, 1,
false, 0, modules_get_unit($id_module), 0, 0, true, $only_image, '',
1, false, '', false, false, false,
$layoutData['image'], null, true,
false, $type_graph) . '</div>';
}
elseif ($layoutData['label_position']=='right') {
$img = '<div style="z-index:'.$show_on_top_index.';float:left;height:'.$himg.'px;">' .
grafico_modulo_sparse($id_module, $period,
0, $width, $height, modules_get_agentmodule_name($id_module), null, false, 1,
false, 0, modules_get_unit($id_module), 0, 0, true, $only_image,
'', 1, false, modules_get_unit($id_module), false, false, false,
$layoutData['image'], null, true,
false, $type_graph) . '</div>';
}
else {
$img = grafico_modulo_sparse($id_module,
$period, 0, $width, $height, modules_get_agentmodule_name($id_module), null,
false, 1, false, 0, modules_get_unit($id_module), 0, 0, true,
$only_image, '', 1, false, '', false,
false, false, $layoutData['image'],
null, false, true, $type_graph);
}
} }
} }
} else {
if ($width == 0 || $height == 0) {
$width = 300;
$height = 180;
}
$params =array(
'agent_module_id' => $id_module,
'period' => $period,
'show_events' => false,
'width' => $width,
'height' => $height,
'title' => modules_get_agentmodule_name($id_module),
'unit' => modules_get_unit($id_module),
'only_image' => $only_image,
'menu' => false,
'backgroundColor' => $layoutData['image'],
'type_graph' => $type_graph
);
if ($layoutData['label_position']=='left') {
$img = '<div style="z-index:'.$show_on_top_index.';float:right;height:'.$himg.'px;">'.
grafico_modulo_sparse($params) . '</div>';
}
elseif($layoutData['label_position']=='right') {
$img = '<div style="z-index:'.$show_on_top_index.';float:left;height:'.$himg.'px;">' .
grafico_modulo_sparse($params) . '</div>';
}
else {
$img = grafico_modulo_sparse($params);
}
}
}
//Restore db connection //Restore db connection
if ($layoutData['id_metaconsole'] != 0) { if ($layoutData['id_metaconsole'] != 0) {
metaconsole_restore_db(); metaconsole_restore_db();
} }
break; break;
case BARS_GRAPH: case BARS_GRAPH:
$imgpos = ''; $imgpos = '';
if($layoutData['label_position']=='left'){ if($layoutData['label_position']=='left'){
$imgpos = 'float:right'; $imgpos = 'float:right';
} }
else if($layoutData['label_position']=='right'){ else if($layoutData['label_position']=='right'){
$imgpos = 'float:left'; $imgpos = 'float:left';
} }
if (!empty($proportion)) { if (!empty($proportion)) {
$width = $width =
((integer)($proportion['proportion_width'] * $width)); ((integer)($proportion['proportion_width'] * $width));

View File

@ -1,7 +1,6 @@
var system = require('system'); var system = require('system');
if (system.args.length < 2 || system.args.length > 6) { if (system.args.length < 2 || system.args.length > 6) {
//console.log('Usage web2image.js url url_parameters output_filename width height');
phantom.exit(1); phantom.exit(1);
} }
@ -22,12 +21,15 @@ if (!_height) {
} }
page.viewportSize = { width: _width, height: _height }; page.viewportSize = { width: _width, height: _height };
//page.zoomFactor = 1.75;
//console.log("Pagina: " + url); //console.log("Pagina: " + url);
//console.log("parametros: " + url_params); //console.log("parametros: " + url_params);
//console.log("Archivo salida: " + output_filename); //console.log("Archivo salida: " + output_filename);
page.open(url + "?" + "data=" + url_params, function start(status) { page.open(url + "?" + "data=" + url_params, function start(status) {
page.render(output_filename, {format: 'png'}); //, 'quality': 100}); page.render(output_filename, {format: 'png'});
//var base64 = page.renderBase64('JPG');
//console.log(base64);
phantom.exit(); phantom.exit();
}); });

View File

@ -136,6 +136,7 @@ class ModuleGraph {
switch ($this->graph_type) { switch ($this->graph_type) {
case 'boolean': case 'boolean':
case 'sparse': case 'sparse':
case 'string':
$params =array( $params =array(
'agent_module_id' => $this->id, 'agent_module_id' => $this->id,
'period' => $this->period, 'period' => $this->period,
@ -164,32 +165,6 @@ class ModuleGraph {
$this->zoom, 'adapted_'.$this->graph_type, $date); $this->zoom, 'adapted_'.$this->graph_type, $date);
} }
break; break;
case 'string':
$graph = grafico_modulo_string(
$this->id,
$this->period,
$this->draw_events,
$this->width,
$this->height,
false,
null,
$this->draw_alerts,
1,
false,
$date,
false,
$urlImage,
'adapter_' . $this->graph_type,
1,
false);
if ($this->draw_events) {
$graph .= '<br>';
$graph .= graphic_module_events($this->id,
$this->width, $this->height,
$this->period, $config['homeurl'],
$this->zoom, 'adapted_' . $this->graph_type, $date);
}
break;
default: default:
$graph .= fs_error_image ('../images'); $graph .= fs_error_image ('../images');
break; break;

View File

@ -235,26 +235,26 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
switch ($graph_type) { switch ($graph_type) {
case 'boolean': case 'boolean':
case 'sparse': case 'sparse':
$params =array( case 'string':
'agent_module_id' => $id, $params =array(
'period' => $period, 'agent_module_id' => $id,
'show_events' => $draw_events, 'period' => $period,
'title' => $label_graph, 'show_events' => $draw_events,
'unit_name' => $unit, 'title' => $label_graph,
'show_alerts' => $draw_alerts, 'unit_name' => $unit,
'avg_only' => $avg_only, 'show_alerts' => $draw_alerts,
'date' => $date, 'avg_only' => $avg_only,
'unit' => $unit, 'date' => $date,
'baseline' => $baseline, 'unit' => $unit,
'homeurl' => $urlImage, 'baseline' => $baseline,
'adapt_key' => 'adapter_' . $graph_type, 'homeurl' => $urlImage,
'compare' => $time_compare, 'adapt_key' => 'adapter_' . $graph_type,
'show_unknown' => $unknown_graph, 'compare' => $time_compare,
'percentil' => (($show_percentil)? $config['percentil'] : null), 'show_unknown' => $unknown_graph,
'type_graph' => $config['type_module_charts'], 'percentil' => (($show_percentil)? $config['percentil'] : null),
'fullscale' => $fullscale 'type_graph' => $config['type_module_charts'],
); 'fullscale' => $fullscale
);
echo grafico_modulo_sparse ($params); echo grafico_modulo_sparse ($params);
echo '<br>'; echo '<br>';
if ($show_events_graph){ if ($show_events_graph){
@ -264,18 +264,6 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
'adapted_' . $graph_type, $date, true); 'adapted_' . $graph_type, $date, true);
} }
break; break;
case 'string':
html_debug_print('entra x stats win hay que rehacer esta funcion');
echo grafico_modulo_string ($id, $period, $draw_events,
$width, $height, $label_graph, null, $draw_alerts, 1,
false, $date, false, $urlImage,
'adapter_' . $graph_type);
echo '<br>';
if ($show_events_graph)
echo graphic_module_events($id, $width, $height,
$period, $config['homeurl'], $zoom,
'adapted_' . $graph_type, $date, true);
break;
default: default:
echo fs_error_image ('../images'); echo fs_error_image ('../images');
break; break;