From a0ada09de9bbf5d7364ebe72414988c76a436272 Mon Sep 17 00:00:00 2001 From: Razvan Crainea Date: Tue, 23 Jul 2024 13:38:43 +0300 Subject: [PATCH] charting: fix users pie when no users available --- web/common/charting/d3js_pie.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/common/charting/d3js_pie.php b/web/common/charting/d3js_pie.php index 2d5027a2..fface7d7 100644 --- a/web/common/charting/d3js_pie.php +++ b/web/common/charting/d3js_pie.php @@ -62,7 +62,7 @@ function display_pie_chart(arg1) { .data(data_ready) .enter() .append('text') - .text(function(d){ return (d.data.key==""?"":d.data.key + " " + ((total?d.data.value/total:0) * 100).toFixed(2) + "%")}) + .text(function(d){ return (d.data.key==""?"":d.data.key + " " + (total!=0?(d.data.value/total * 100):0).toFixed(2) + "%")}) .attr("transform", function(d) { return "translate(" + arcGenerator.centroid(d) + ")"; }) .style("text-anchor", "middle") .style("font-size", 9)