mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
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:
parent
a026b60653
commit
32fd5af904
@ -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);
|
||||
}
|
||||
|
||||
|
34
test/fixtures/scale.radialLinear/pointLabels/no-more-than-half-radius.js
vendored
Normal file
34
test/fixtures/scale.radialLinear/pointLabels/no-more-than-half-radius.js
vendored
Normal 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
|
||||
}
|
||||
}
|
||||
};
|
BIN
test/fixtures/scale.radialLinear/pointLabels/no-more-than-half-radius.png
vendored
Normal file
BIN
test/fixtures/scale.radialLinear/pointLabels/no-more-than-half-radius.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
Loading…
Reference in New Issue
Block a user