From 0e75c2bd9b1352a8ef0f0dac2f24a0b73656868a Mon Sep 17 00:00:00 2001 From: boygirl Date: Wed, 24 May 2017 12:56:55 -0700 Subject: [PATCH] round label positions --- src/components/helper-methods.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/helper-methods.js b/src/components/helper-methods.js index 0ef0aed..72d965a 100644 --- a/src/components/helper-methods.js +++ b/src/components/helper-methods.js @@ -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), @@ -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()