Merge branch '1397-Grafica-combinada-y-fondo-negro-transparente-Consola-visual' into 'develop'

Enable background color options for gauge charts - #1397

See merge request artica/pandorafms!900
This commit is contained in:
vgilc 2017-10-26 13:35:44 +02:00
commit 2f9d999978
4 changed files with 23 additions and 6 deletions

View File

@ -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;
}
}

View File

@ -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'];

View File

@ -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 () {

View File

@ -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 .= "</script>";