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)