Skip to content

Commit e7b0ca3

Browse files
committed
Fix spacing applied to doughnut label
1 parent 2ef1f31 commit e7b0ca3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/types/doughnutLabel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function getControllerMeta({chartArea}, options, meta) {
136136
y: (square.top + square.bottom) / 2
137137
};
138138
const space = options.spacing + options.borderWidth / 2;
139-
const _radius = innerRadius - space;
139+
const _radius = Math.max(innerRadius - space, 0);
140140
const _counterclockwise = point.y > y;
141141
const side = _counterclockwise ? top + space : bottom - space;
142142
const angles = getAngles(side, x, y, _radius);
@@ -150,7 +150,7 @@ function getControllerMeta({chartArea}, options, meta) {
150150
return {
151151
controllerMeta,
152152
point,
153-
radius: Math.min(innerRadius, Math.min(square.right - square.left, square.bottom - square.top) / 2)
153+
radius: Math.min(_radius, Math.min(square.right - square.left, square.bottom - square.top) / 2)
154154
};
155155
}
156156

0 commit comments

Comments
 (0)