mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
add 10 to yLabelWidth on set, rather than on use
This commit is contained in:
parent
1cfa42bc24
commit
5ab5e8400a
@ -1411,7 +1411,7 @@
|
||||
for (var i=0; i<=this.steps; i++){
|
||||
this.yLabels.push(template(this.templateString,{value:(this.min + (i * this.stepValue)).toFixed(stepDecimalPlaces)}));
|
||||
}
|
||||
this.yLabelWidth = (this.display && this.showLabels) ? longestText(this.ctx,this.font,this.yLabels) : 0;
|
||||
this.yLabelWidth = (this.display && this.showLabels) ? longestText(this.ctx,this.font,this.yLabels) + 10 : 0;
|
||||
},
|
||||
addXLabel : function(label){
|
||||
this.xLabels.push(label);
|
||||
@ -1484,7 +1484,7 @@
|
||||
|
||||
|
||||
this.xScalePaddingRight = lastWidth/2 + 3;
|
||||
this.xScalePaddingLeft = (firstWidth/2 > this.yLabelWidth + 10) ? firstWidth/2 : this.yLabelWidth + 10;
|
||||
this.xScalePaddingLeft = (firstWidth/2 > this.yLabelWidth) ? firstWidth/2 : this.yLabelWidth;
|
||||
|
||||
this.xLabelRotation = 0;
|
||||
if (this.display){
|
||||
@ -1503,7 +1503,7 @@
|
||||
lastRotated = cosRotation * lastWidth;
|
||||
|
||||
// We're right aligning the text now.
|
||||
if (firstRotated + this.fontSize / 2 > this.yLabelWidth + 8){
|
||||
if (firstRotated + this.fontSize / 2 > this.yLabelWidth){
|
||||
this.xScalePaddingLeft = firstRotated + this.fontSize / 2;
|
||||
}
|
||||
this.xScalePaddingRight = this.fontSize/2;
|
||||
|
Loading…
Reference in New Issue
Block a user