diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 9d66670864..5d33c49a01 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2119,7 +2119,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, case CUSTOM_GRAPH_PIE: return ring_graph($flash_charts, $graph_values, $width, $height, $others_str, $homeurl, $water_mark, $config['fontpath'], - ($config['font_size']+1), $ttl, false, $color, false); + ($config['font_size']+1), $ttl, false, $color, false,$background_color); break; } } diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index b04057b12e..74a2ea251d 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -784,7 +784,7 @@ function pie_graph($graph_type, $flash_chart, $chart_data, $width, function ring_graph($flash_chart, $chart_data, $width, $height, $others_str = "other", $homedir="", $water_mark = "", $font = '', $font_size = '', $ttl = 1, $legend_position = false, - $colors = '', $hide_labels = false) { + $colors = '', $hide_labels = false,$background_color = 'white') { if (empty($chart_data)) { return graph_nodata_image($width, $height, 'pie'); @@ -800,7 +800,7 @@ function ring_graph($flash_chart, $chart_data, $width, return flot_custom_pie_chart ($flash_chart, $chart_data, $width, $height, $colors, $module_name_list, $long_index, $no_data, false, '', $water_mark, $font, $font_size, - $unit, $ttl, $homeurl, $background_color, $legend_position); + $unit, $ttl, $homeurl, $background_color, $legend_position,$background_color); } else { $total_modules = $chart_data['total_modules']; diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 277a060f43..10b98be29b 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -119,7 +119,8 @@ function pandoraFlotPie(graph_id, values, labels, nseries, width, font_size, wat function pandoraFlotPieCustom(graph_id, values, labels, width, font_size, font, water_mark, separator, legend_position, height, - colors,legend) { + colors,legend,background_color) { + font = font.split("/").pop().split(".").shift(); var labels = labels.split(separator); var legend = legend.split(separator); @@ -211,8 +212,24 @@ function pandoraFlotPieCustom(graph_id, values, labels, width, $('.legend>table').css('right',($('.legend>div').height()*-1)); } //$('.legend>table').css('border',"1px solid #E2E2E2"); - $('.legend>table').css('background-color',"transparent"); + if(background_color == 'transparent'){ + $('.legend>table').css('background-color',""); + $('.legend>div').css('background-color',""); + $('.legend>table').css('color',"#aaa"); + } + else if (background_color == 'white') { + $('.legend>table').css('background-color',"white"); + $('.legend>table').css('color',"black"); + } + else if (background_color == 'black') { + $('.legend>table').css('background-color',"black"); + $('.legend>table').css('color',"#aaa"); + } + + $('.legend').over(function(){ + return false; + }); var pielegends = $('#'+graph_id+' .pieLabelBackground'); pielegends.each(function () { diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 35b9ee7a09..58b193b0e7 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -666,7 +666,7 @@ function flot_custom_pie_chart ($flash_charts, $graph_values, $return .= "pandoraFlotPieCustom('$graph_id', '$values', '$labels', '$width', $font_size, '$fontpath', $water_mark, - '$separator', '$legend_position', '$height', '$colors','$legend')"; + '$separator', '$legend_position', '$height', '$colors','$legend','$background_color')"; $return .= "";