mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Only rotate label while rotation is < maxRotation
Checking for <= maxRotation results in a labelRotation of 1 if maxRotation is 0, which doesn't make any sense (and also causes the text to be right aligned not centred)
This commit is contained in:
parent
36493e042e
commit
d7ab51f29b
@ -147,7 +147,7 @@
|
||||
var datasetWidth = Math.floor(this.getPixelForValue(0, 1) - this.getPixelForValue(0, 0)) - 6;
|
||||
|
||||
//Max label rotation can be set or default to 90 - also act as a loop counter
|
||||
while (this.labelWidth > datasetWidth && this.labelRotation <= this.options.labels.maxRotation) {
|
||||
while (this.labelWidth > datasetWidth && this.labelRotation < this.options.labels.maxRotation) {
|
||||
cosRotation = Math.cos(helpers.toRadians(this.labelRotation));
|
||||
sinRotation = Math.sin(helpers.toRadians(this.labelRotation));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user