Radial: min 1/2 of the max radius as chartArea (#8630)

* Radial: min 1/2 of the max radius as chartArea

* Keep fooling TS
This commit is contained in:
Jukka Kurkela 2021-03-13 20:47:21 +02:00 committed by GitHub
parent a026b60653
commit 32fd5af904
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 2 deletions

View File

@ -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);
}

View File

@ -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
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB