From a2ab92f90b4187c476116864cd3eebe1137cc971 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 29 Apr 2024 13:04:01 +0200 Subject: [PATCH] #13507 Fixed dark theme style in the Netflow explorer chart label. --- pandora_console/include/functions_netflow.php | 8 ++++++-- .../artica/phpchartjs/src/Renderer/JavaScript.php | 11 +++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index 9f016ac88a..247b81a816 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -1570,8 +1570,12 @@ function netflow_draw_item( ); // Theme. - $theme = $config['style']; - $text_color = ($theme !== 'pandora_black') ? '#333' : '#fff'; + $user_info = get_user_info($config['id_user']); + if (isset($user_info['id_skin']) === true && (int) $user_info['id_skin'] === 2) { + $text_color = '#ffffff'; + } else { + $text_color = '#333333'; + } $graph_output = pie_graph( $pie_data, diff --git a/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php b/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php index 6b4848cb00..9462f5c803 100644 --- a/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php +++ b/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php @@ -128,6 +128,13 @@ class JavaScript extends Renderer } } };'; + + if ($this->chart->options()->getTheme() !== null) { + if ((int) $this->chart->options()->getTheme() === 2) { + $script[] = 'Chart.defaults.color = "#ffffff";'; + } + } + $script[] = 'Chart.register(chart_watermark_'.$this->chart->getId().');'; } @@ -163,6 +170,10 @@ class JavaScript extends Renderer if (chart.config.options.title !== undefined ) { chart.config.options.title.fontColor = "#ffffff"; } + + if (chart.config.options.plugins.legend.labels.font !== undefined ) { + chart.config.options.plugins.legend.labels.font.color = "#ffffff"; + } '; } }