diff --git a/src/scales/scale.radialLinear.js b/src/scales/scale.radialLinear.js index f6d9270b9..298717aaf 100644 --- a/src/scales/scale.radialLinear.js +++ b/src/scales/scale.radialLinear.js @@ -348,9 +348,9 @@ export default class RadialLinearScale extends LinearScaleBase { radiusReductionTop = numberOrZero(radiusReductionTop); radiusReductionBottom = numberOrZero(radiusReductionBottom); - me.drawingArea = Math.min( + me.drawingArea = Math.max(largestPossibleRadius / 2, Math.min( Math.floor(largestPossibleRadius - (radiusReductionLeft + radiusReductionRight) / 2), - Math.floor(largestPossibleRadius - (radiusReductionTop + radiusReductionBottom) / 2)); + Math.floor(largestPossibleRadius - (radiusReductionTop + radiusReductionBottom) / 2))); me.setCenterPoint(radiusReductionLeft, radiusReductionRight, radiusReductionTop, radiusReductionBottom); } diff --git a/test/fixtures/scale.radialLinear/pointLabels/no-more-than-half-radius.js b/test/fixtures/scale.radialLinear/pointLabels/no-more-than-half-radius.js new file mode 100644 index 000000000..cddd4362d --- /dev/null +++ b/test/fixtures/scale.radialLinear/pointLabels/no-more-than-half-radius.js @@ -0,0 +1,34 @@ +module.exports = { + config: { + type: 'radar', + data: { + labels: ['Too long label 1', 'Too long label 2', 'Too long label 3', 'Too long label 4'], + datasets: [ + { + backgroundColor: '#E43E51', + data: [1, 1, 1, 1] + } + ] + }, + options: { + scales: { + r: { + max: 1, + ticks: { + display: false, + }, + grid: { + display: false + } + } + }, + } + }, + options: { + spriteText: true, + canvas: { + width: 256, + height: 256 + } + } +}; diff --git a/test/fixtures/scale.radialLinear/pointLabels/no-more-than-half-radius.png b/test/fixtures/scale.radialLinear/pointLabels/no-more-than-half-radius.png new file mode 100644 index 000000000..522292ef8 Binary files /dev/null and b/test/fixtures/scale.radialLinear/pointLabels/no-more-than-half-radius.png differ