]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Compute correct tooltip size when there is no title present (#3324)
authorEvert Timberg <evert.timberg+github@gmail.com>
Sat, 24 Sep 2016 08:58:31 +0000 (04:58 -0400)
committerSimon Brunel <simonbrunel@users.noreply.github.com>
Sat, 24 Sep 2016 08:58:31 +0000 (10:58 +0200)
src/core/core.tooltip.js

index 5edfd0075f8d98c4195509afe6c626c824906593..d0068ee674dfdfe56819900e443c1b1d40978b8d 100755 (executable)
@@ -354,7 +354,7 @@ module.exports = function(Chart) {
                                footerFontSize = vm.footerFontSize;
 
                        size.height += titleLineCount * titleFontSize; // Title Lines
-                       size.height += (titleLineCount - 1) * vm.titleSpacing; // Title Line Spacing
+                       size.height += titleLineCount ? (titleLineCount - 1) * vm.titleSpacing : 0; // Title Line Spacing
                        size.height += titleLineCount ? vm.titleMarginBottom : 0; // Title's bottom Margin
                        size.height += combinedBodyLength * bodyFontSize; // Body Lines
                        size.height += combinedBodyLength ? (combinedBodyLength - 1) * vm.bodySpacing : 0; // Body Line Spacing