Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #146 from FormidableLabs/round-label-positions
Browse files Browse the repository at this point in the history
round label positions
  • Loading branch information
boygirl authored May 24, 2017
2 parents 8779e3a + 0e75c2b commit 882b98f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/helper-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ export default {
return {
index, datum, data, slice, orientation,
style: labelStyle,
x: position[0],
y: position[1],
x: Math.round(position[0]),
y: Math.round(position[1]),
text: this.getLabelText(props, datum, index),
textAnchor: labelStyle.textAnchor || this.getTextAnchor(orientation),
verticalAnchor: labelStyle.verticalAnchor || this.getVerticalAnchor(orientation),
Expand Down Expand Up @@ -103,7 +103,6 @@ export default {
},

getLabelPosition(radius, labelRadius, style) {
// TODO: better label positioning
const padding = style && style.padding || 0;
const arcRadius = labelRadius || radius + padding;
return d3Shape.arc()
Expand Down

0 comments on commit 882b98f

Please sign in to comment.