From ff175d15ea04786b72303d76d2b74ed28d5731f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6khan=20=C3=96zen?= Date: Thu, 4 Feb 2016 15:14:34 +0100 Subject: [PATCH] optimized position of arc label line --- src/arc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arc.js b/src/arc.js index 15aa105..2051beb 100644 --- a/src/arc.js +++ b/src/arc.js @@ -313,8 +313,8 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf var updated = $$.updateAngle(d), innerLineLength = $$.gaugeArcWidth / $$.visibleTargetCount * (updated.index + 1), lineAngle = updated.endAngle - Math.PI / 2, - linePositioningAngle = lineAngle - Math.PI / 180 / 3, - arcInnerRadius = $$.radius - innerLineLength; + arcInnerRadius = $$.radius - innerLineLength, + linePositioningAngle = lineAngle - (arcInnerRadius === 0 ? 0 : (1 / arcInnerRadius)); lineLength = $$.radiusExpanded - $$.radius + innerLineLength; x = Math.cos(linePositioningAngle) * arcInnerRadius; y = Math.sin(linePositioningAngle) * arcInnerRadius;