From 7c68b6eeffa20a70cb33d1b4779883eb913f9634 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Fri, 6 Nov 2015 10:34:11 +0100 Subject: [PATCH] Fixed custom graphs when include new type of graphs. (cherry picked from commit f7c2d45210e77960ccd3d881150c910c52c4c6ca) --- .../ajax/visual_console_builder.ajax.php | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index 22a96136a9..de1de94783 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -787,8 +787,27 @@ switch ($action) { break; case 'module_graph': $values['type'] = MODULE_GRAPH; - $values['height'] = $height_module_graph; - $values['width'] = $width_module_graph; + if ($values['id_custom_graph'] > 0 ) { + $values['height'] = $height_module_graph; + $values['width'] = $width_module_graph; + + $graph_conf = db_get_row('tgraph', 'id_graph', $values['id_custom_graph']); + $graph_stacked = $graph_conf['stacked']; + if ( $graph_stacked == CUSTOM_GRAPH_BULLET_CHART) { + $values['height'] = 50; + } + elseif ($graph_stacked == CUSTOM_GRAPH_GAUGE ){ + if ( $height_module_graph < 150 ) + $values['height'] = 150; + elseif( $height_module_graph >= 150 && $height_module_graph < 250 ) + $values['height'] = $graph_height; + elseif( $height_module_graph >= 250 ) + $values['height'] = 200; + } + } else { + $values['height'] = $height_module_graph; + $values['width'] = $width_module_graph; + } $values['period'] = $period; break; case 'percentile_item':