diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index f3ff4c9821..fa161981f7 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1530,6 +1530,11 @@ function graphic_combined_module( } $long_index = ''; + if ($config['style'] === 'pandora_black') { + $background_color = '#222'; + $params['legend_color'] = '#fff'; + } + switch ($params_combined['stacked']) { default: case CUSTOM_GRAPH_STACKED_LINE: diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 6637f5729a..06ddf7d9f3 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -218,6 +218,9 @@ function vbar_graph( if (isset($options['x']['font']['color']) === false) { $options['x']['font']['color'] = '#545454'; + if ($config['style'] === 'pandora_black') { + $options['x']['font']['color'] = '#fff'; + } } // Show ticks. @@ -295,6 +298,10 @@ function vbar_graph( if (isset($options['y']['font']['color']) === false) { $options['y']['font']['color'] = '#545454'; + + if ($config['style'] === 'pandora_black') { + $options['y']['font']['color'] = '#fff'; + } } // Show ticks. @@ -692,6 +699,7 @@ function hbar_graph( $val_max=null, $base64=false ) { + global $config; if ($water_mark !== false) { setup_watermark($water_mark, $water_mark_file, $water_mark_url); } @@ -717,6 +725,10 @@ function hbar_graph( return generator_chart_to_pdf('hbar', $params); } + if ($config['style'] === 'pandora_black') { + $tick_color = '#fff'; + } + return flot_hcolumn_chart( $chart_data, $width, diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 8c05fde3ec..6a145e3e6f 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -114,7 +114,7 @@ function pandoraFlotPie( // Reset styles function resetInteractivity() { - legends.css("color", "#3F3F3D"); + legends.css("color", "#fff"); } if (water_mark) { @@ -241,6 +241,10 @@ function pandoraFlotPieCustom( } else if (background_color == "black") { $(".legend>table").css("background-color", "black"); $(".legend>table").css("color", "#aaa"); + } else if (background_color == "black_theme") { + $(".legend>table").css("background-color", "#222"); + $(".legend>div").css("background-color", "#222"); + $(".legend>table").css("color", "#fff !important"); } $(".legend").hover(function() { @@ -258,7 +262,11 @@ function pandoraFlotPieCustom( if (!obj) return; var index = obj.seriesIndex; - legends.css("color", "#3F3F3D"); + if (background_color == "black_theme") { + legends.css("color", "#fff"); + } else { + legends.css("color", "#3F3F3D"); + } legends.eq(index).css("color", ""); } @@ -285,6 +293,7 @@ function pandoraFlotPieCustom( function resetInteractivity() { legends.each(function() { // fix the widths so they don't jump around + console.log($(this)); $(this).css("color", "#3F3F3D"); }); } @@ -349,6 +358,11 @@ function pandoraFlotHBars( labels_total.push([i, labels[i]]); } + var ycolor = "rgb(84, 84, 84)"; + + if (background_color == "#222") { + var ycolor = "#fff"; + } var options = { series: { bars: { @@ -377,7 +391,7 @@ function pandoraFlotHBars( yaxis: { font: { size: font_size + 2, - color: "rgb(84, 84, 84)", + color: ycolor, family: font + "Font" }, ticks: yFormatter @@ -2364,7 +2378,7 @@ function pandoraFlotArea( $("#legend_" + graph_id).height() ); - $("#timestamp_" + graph_id).css("color", legend_color); + $("#timestamp_" + graph_id).css("color", "#000"); $("#timestamp_" + graph_id).css("font-size", font_size + 2 + "px"); $("#timestamp_" + graph_id).css("font-family", font + "Font"); diff --git a/pandora_console/include/graphs/functions_d3.php b/pandora_console/include/graphs/functions_d3.php index abba81ea72..af0014373f 100644 --- a/pandora_console/include/graphs/functions_d3.php +++ b/pandora_console/include/graphs/functions_d3.php @@ -201,6 +201,11 @@ function d3_bullet_chart( $id_bullet = uniqid(); $font = array_shift(explode('.', array_pop(explode('/', $font)))); + $invert_color = ''; + if ($config['style'] === 'pandora_black') { + $invert_color = 'filter: invert(100%);'; + } + $output .= '
'; return $output; diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 895928fe64..aff51b5f7b 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -145,6 +145,13 @@ function flot_area_graph( break; } + if ($config['style'] === 'pandora_black') { + $background_style = '#222'; + $params['grid_color'] = '#fff'; + $params['backgroundColor'] = '#222'; + $params['legend_color'] = '#fff'; + } + // Parent layer. if (strpos($params['width'], '%') === false) { $width = 'width: '.$params['width'].'px;'; @@ -244,7 +251,7 @@ function flot_area_graph( style='font-size:".$params['font_size']."pt; display:none; position:absolute; background:#fff; border: solid 1px #aaa; - padding: 2px; z-index:1000; + padding: 2px; z-index:1000; color: #000; '>"; $return .= "