From af8b3c6e57128a338b398af192545ea4adb6f66d Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Mon, 25 Jan 2016 09:53:05 +0100 Subject: [PATCH] Fixed vertical and horizontal bars when print PDF. Tiquet: #3255 --- pandora_console/include/functions_graph.php | 2 +- pandora_console/include/graphs/fgraph.php | 3 +-- .../include/graphs/functions_pchart.php | 22 +++++++------------ 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index c5caaaffaa..ed61c5ddc3 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1419,7 +1419,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, $label = $labels[$module]; else $label = $agent_name . " - " .$module_data['nombre']; - $temp[$label]['g'] = $temp_data; + $temp[$label]['g'] = round($temp_data,4); } break; diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index a399647450..10fcd81883 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -192,11 +192,10 @@ function vbar_graph($flash_chart, $chart_data, $width, $height, $graph['water_mark'] = $water_mark_file; $graph['font'] = $font; $graph['font_size'] = $font_size; - $graph['force_steps'] = $force_steps; $id_graph = serialize_in_temp($graph, null, $ttl); - return ""; + return ""; } } diff --git a/pandora_console/include/graphs/functions_pchart.php b/pandora_console/include/graphs/functions_pchart.php index 2803ea4224..f5365f8aff 100644 --- a/pandora_console/include/graphs/functions_pchart.php +++ b/pandora_console/include/graphs/functions_pchart.php @@ -178,21 +178,15 @@ switch ($graph_type) { $fine_colors = array(); // If is set fine colors we store it or set default - if (isset($colors[reset(array_keys($data_values))]['fine'])) { - $fine = $colors[reset(array_keys($data_values))]['fine']; - if ($fine === true) { - $fine = $default_fine_colors; - } - - foreach ($fine as $i => $fine_color) { - $rgb_fine = html_html2rgb($fine_color); - $fine_colors[$i]['R'] = $rgb_fine[0]; - $fine_colors[$i]['G'] = $rgb_fine[1]; - $fine_colors[$i]['B'] = $rgb_fine[2]; - $fine_colors[$i]['Alpha'] = 100; - } - $colors = array(); + + foreach ($colors as $i => $fine_color) { + $rgb_fine = html_html2rgb($fine_color); + $fine_colors[$i]['R'] = $rgb_fine[0]; + $fine_colors[$i]['G'] = $rgb_fine[1]; + $fine_colors[$i]['B'] = $rgb_fine[2]; + $fine_colors[$i]['Alpha'] = 100; } + $colors = $fine_colors; break; case 'progress':