Skip to content

Commit

Permalink
Bug #529 - Pie Chart - Avoid hashing label positions for slices that …
Browse files Browse the repository at this point in the history
…have no value
  • Loading branch information
Robinson7D committed May 7, 2014
1 parent 0c03b27 commit 9d74523
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/models/pie.js
Expand Up @@ -220,11 +220,13 @@ nv.models.pie = function() {
Adjust the label's y-position to remove the overlap.
*/
var center = labelsArc.centroid(d);
var hashKey = createHashKey(center);
if (labelLocationHash[hashKey]) {
center[1] -= avgHeight;
if(d.value){
var hashKey = createHashKey(center);
if (labelLocationHash[hashKey]) {
center[1] -= avgHeight;
}
labelLocationHash[createHashKey(center)] = true;
}
labelLocationHash[createHashKey(center)] = true;
return 'translate(' + center + ')'
}
});
Expand Down

0 comments on commit 9d74523

Please sign in to comment.