mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-07 04:39:06 +02:00
commit
fe427d67af
@ -192,13 +192,14 @@
|
|||||||
if (this.isHorizontal()) {
|
if (this.isHorizontal()) {
|
||||||
minSize.width = maxWidth;
|
minSize.width = maxWidth;
|
||||||
} else if (this.options.display) {
|
} else if (this.options.display) {
|
||||||
minSize.width = Math.min(longestLabelWidth + 6, maxWidth);
|
var labelWidth = this.options.labels.show ? longestLabelWidth + 6 : 0;
|
||||||
|
minSize.width = Math.min(labelWidth, maxWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Height
|
// Height
|
||||||
if (this.isHorizontal() && this.options.display) {
|
if (this.isHorizontal() && this.options.display) {
|
||||||
var labelHeight = (Math.sin(helpers.toRadians(this.labelRotation)) * longestLabelWidth) + 1.5 * this.options.labels.fontSize;
|
var labelHeight = (Math.sin(helpers.toRadians(this.labelRotation)) * longestLabelWidth) + 1.5 * this.options.labels.fontSize;
|
||||||
minSize.height = Math.min(labelHeight, maxHeight);
|
minSize.height = Math.min(this.options.labels.show ? labelHeight : 0, maxHeight);
|
||||||
} else if (this.options.display) {
|
} else if (this.options.display) {
|
||||||
minSize.height = maxHeight;
|
minSize.height = maxHeight;
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@
|
|||||||
} else {
|
} else {
|
||||||
// Bottom - top since pixels increase downard on a screen
|
// Bottom - top since pixels increase downard on a screen
|
||||||
var innerHeight = this.height - (this.paddingTop + this.paddingBottom);
|
var innerHeight = this.height - (this.paddingTop + this.paddingBottom);
|
||||||
pixel = this.bottom - (innerHeight / range * (value - this.start));
|
pixel = (this.bottom - this.paddingBottom) - (innerHeight / range * (value - this.start));
|
||||||
pixel += this.paddingTop;
|
pixel += this.paddingTop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user