From 54b70e5927e22e750028fcef976e463cbabe9705 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Fri, 26 May 2017 12:55:37 +0200 Subject: [PATCH] Changed custom graph size specs in visual console --- .../include/functions_visual_map.php | 47 ++++++++++--------- .../operation/visual_console/render_view.php | 20 +------- 2 files changed, 27 insertions(+), 40 deletions(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 2fcd7254a4..60125340ff 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -898,47 +898,52 @@ function visual_map_print_item($mode = "read", $layoutData, if ($width == 0 || $height == 0) { if ($layoutData['label_position']=='left') { $img = '
'.custom_graphs_print( - $layoutData['id_custom_graph'], 180, 300, + $layoutData['id_custom_graph'], 180, 480, $period, null, true, 0, $only_image, $layoutData['image'], array(), '', array(), array(), true, false, false, true, 1, false, true).'
'; } elseif ($layoutData['label_position']=='right') { $img = '
'.custom_graphs_print( - $layoutData['id_custom_graph'], 180, 300, + $layoutData['id_custom_graph'], 180, 480, $period, null, true, 0, $only_image, $layoutData['image'], array(), '', array(), array(), true, false, false, true, 1, false, true).'
'; } else { $img = custom_graphs_print( - $layoutData['id_custom_graph'], 180, 300, + $layoutData['id_custom_graph'], 180, 480, $period, null, true, 0, $only_image, $layoutData['image'], array(), '', array(), array(), true, false, false, true, 1, false, true); } } else { - if ($layoutData['label_position']=='left') { - $img = '
'.custom_graphs_print( - $layoutData['id_custom_graph'], $height, $width, - $period, null, true, 0, $only_image, $layoutData['image'], - array(), '', array(), array(), true, - false, false, true, 1, false, true).'
'; - } - elseif($layoutData['label_position']=='right') { - $img = '
'.custom_graphs_print( - $layoutData['id_custom_graph'], $height, $width, - $period, null, true, 0, $only_image, $layoutData['image'], - array(), '', array(), array(), true, - false, false, true, 1, false, true).'
'; + if ($width < 480){ + $img = '
'._("Could not draw pie with labels contained inside canvas. Resize widget to 500px width minimum").'
'; } else { - $img = custom_graphs_print( - $layoutData['id_custom_graph'], $height, $width, - $period, null, true, 0, $only_image, $layoutData['image'], - array(), '', array(), array(), true, - false, false, true, 1, false, true); + if ($layoutData['label_position']=='left') { + $img = '
'.custom_graphs_print( + $layoutData['id_custom_graph'], $height, $width, + $period, null, true, 0, $only_image, $layoutData['image'], + array(), '', array(), array(), true, + false, false, true, 1, false, true).'
'; + } + elseif($layoutData['label_position']=='right') { + $img = '
'.custom_graphs_print( + $layoutData['id_custom_graph'], $height, $width, + $period, null, true, 0, $only_image, $layoutData['image'], + array(), '', array(), array(), true, + false, false, true, 1, false, true).'
'; + } + else { + $img = custom_graphs_print( + $layoutData['id_custom_graph'], $height, $width, + $period, null, true, 0, $only_image, $layoutData['image'], + array(), '', array(), array(), true, + false, false, true, 1, false, true); + } } } } diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php index 0d3d2a8c78..79101d82ee 100755 --- a/pandora_console/operation/visual_console/render_view.php +++ b/pandora_console/operation/visual_console/render_view.php @@ -254,7 +254,7 @@ $ignored_params['refr'] = ''; } startCountDown(refr, false); - //~ // Auto hide controls + var controls = document.getElementById('vc-controls'); autoHideElement(controls, 1000); @@ -315,24 +315,6 @@ $ignored_params['refr'] = ''; height = parseInt($(this).css("height")) - 30; $(this).css('height', height); }); - - /* - $('.percentile_item a > img').each(function(){ - - if($(this).css('float')=='left' || $(this).css('float')=='right'){ - - - $(this).css('margin-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px'); - $(this).css('margin-left',''); - - } - else{ - $(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px'); - $(this).css('margin-top',''); - } - - }); - */ }); \ No newline at end of file