mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Merge pull request #1069 from mackuba/fix_endpoint
Prevent taking vertical space for X labels more than once
This commit is contained in:
commit
b5692c8534
@ -1554,6 +1554,9 @@
|
||||
this.startPoint += this.padding;
|
||||
this.endPoint -= this.padding;
|
||||
|
||||
// Cache the starting endpoint, excluding the space for x labels
|
||||
var cachedEndPoint = this.endPoint;
|
||||
|
||||
// Cache the starting height, so can determine if we need to recalculate the scale yAxis
|
||||
var cachedHeight = this.endPoint - this.startPoint,
|
||||
cachedYLabelWidth;
|
||||
@ -1585,6 +1588,7 @@
|
||||
|
||||
// Only go through the xLabel loop again if the yLabel width has changed
|
||||
if (cachedYLabelWidth < this.yLabelWidth){
|
||||
this.endPoint = cachedEndPoint;
|
||||
this.calculateXLabelRotation();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user