diff --git a/pandora_console/include/graphs/functions_d3.php b/pandora_console/include/graphs/functions_d3.php index b9f2212b16..e3962bf729 100644 --- a/pandora_console/include/graphs/functions_d3.php +++ b/pandora_console/include/graphs/functions_d3.php @@ -740,6 +740,8 @@ function print_donut_narrow_graph( array $data, $data_total ) { + global $config; + if (empty($data)) { return graph_nodata_image($width, $height, 'pie'); } @@ -754,10 +756,31 @@ function print_donut_narrow_graph( $graph_id = uniqid('graph_'); + // This is for "Style template" in visual styles. + switch ($config['style']) { + case 'pandora': + $textColor = '#000'; + $strokeColor = '#fff'; + break; + + case 'pandora_black': + $textColor = '#fff'; + $strokeColor = '#222'; + break; + + default: + $textColor = '#000'; + $strokeColor = 'transparent'; + break; + } + + $textColor = json_encode($textColor); + $strokeColor = json_encode($strokeColor); + $out = "
"; $out .= include_javascript_d3(true); $out .= "