From a1d02e4f4dfc222ef8aede2dd30a97f187e1a26e Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 17 May 2023 09:50:08 +0200 Subject: [PATCH] #11233 fixed bug no data in basic chart --- .../lib/Dashboard/Widgets/BasicChart.php | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php b/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php index 8041cf77d9..ec02614285 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php +++ b/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php @@ -561,7 +561,6 @@ class BasicChart extends Widget global $config; $size = parent::getSize(); - hd($size, true); include_once $config['homedir'].'/include/functions_graph.php'; include_once $config['homedir'].'/include/functions_agents.php'; @@ -625,16 +624,20 @@ class BasicChart extends Widget ], ]; + $graph = \grafico_modulo_sparse($params); $output = '
'; - $output .= '
'; - $output .= ''; - $output .= ((bool) $this->values['showLabel'] === true) ? $title : ''; - $output .= ''; - $output .= ''; - $output .= ((bool) $this->values['showValue'] === true) ? $value : ''; - $output .= ''; - $output .= '
'; - $output .= \grafico_modulo_sparse($params); + if (str_contains($graph, 'values['colorLabel'].'; font-size:'.$this->values['sizeLabel'].'px;">'; + $output .= ((bool) $this->values['showLabel'] === true) ? $title : ''; + $output .= ''; + $output .= ''; + $output .= ((bool) $this->values['showValue'] === true) ? $value : ''; + $output .= ''; + $output .= '
'; + } + + $output .= $graph; $output .= ''; return $output; }