Merge pull request #1403 from etimberg/fix/labelArea

Fixes #1393
This commit is contained in:
Evert Timberg 2015-08-22 14:36:00 -04:00
commit fe427d67af
2 changed files with 4 additions and 3 deletions

View File

@ -192,13 +192,14 @@
if (this.isHorizontal()) {
minSize.width = maxWidth;
} 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
if (this.isHorizontal() && this.options.display) {
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) {
minSize.height = maxHeight;
}

View File

@ -172,7 +172,7 @@
} else {
// Bottom - top since pixels increase downard on a screen
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;
}