Skip to content

Commit

Permalink
charting: fix users pie when no users available
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Jul 23, 2024
1 parent 0b9a1e4 commit a0ada09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/common/charting/d3js_pie.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a0ada09

Please sign in to comment.