]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fix a few more issues in the tooltips 1749/head
authorEvert Timberg <evert.timberg@gmail.com>
Mon, 7 Dec 2015 23:23:51 +0000 (18:23 -0500)
committerEvert Timberg <evert.timberg@gmail.com>
Mon, 7 Dec 2015 23:23:51 +0000 (18:23 -0500)
src/core/core.tooltip.js

index 97a9e779296c18557d99f339984e69ef1ad7a7f4..cbc3111b059631fd6d0385b1563850fb63a45a14 100644 (file)
 
                                var tooltipItems = [];
 
-                               if (this._options.tooltips.mode == 'single') {
+                               if (this._options.tooltips.mode === 'single') {
                                        var yScale = element._yScale || element._scale; // handle radar || polarArea charts
                                        tooltipItems.push({
                                                xLabel: element._xScale ? element._xScale.getLabelForIndex(element._index, element._datasetIndex) : '',
                        });
                        helpers.each(vm.body, function(line) {
                                ctx.font = helpers.fontString(vm.bodyFontSize, vm._bodyFontStyle, vm._bodyFontFamily);
-                               tooltipWidth = Math.max(tooltipWidth, ctx.measureText(line).width + (this._options.tooltips.mode != 'single' ? (vm.bodyFontSize + 2) : 0));
+                               tooltipWidth = Math.max(tooltipWidth, ctx.measureText(line).width + (this._options.tooltips.mode !== 'single' ? (vm.bodyFontSize + 2) : 0));
                        }, this);
                        helpers.each(vm.footer, function(line) {
                                ctx.font = helpers.fontString(vm.footerFontSize, vm._footerFontStyle, vm._footerFontFamily);
 
                                // Before Body
                                helpers.each(vm.beforeBody, function(beforeBody) {
-                                       ctx.fillText(vm.beforeBody, xBase, yBase);
+                                       ctx.fillText(beforeBody, xBase, yBase);
                                        yBase += vm.bodyFontSize + vm.bodySpacing;
                                });
 
 
                                // After Body
                                helpers.each(vm.afterBody, function(afterBody) {
-                                       ctx.fillText(vm.afterBody, xBase, yBase);
+                                       ctx.fillText(afterBody, xBase, yBase);
                                        yBase += vm.bodyFontSize;
                                });