From: Rittyan Date: Mon, 2 Oct 2017 22:33:03 +0000 (+0900) Subject: fix colour settings of BeforeLabel and BeforeBody (#4783) X-Git-Tag: v2.7.1~1^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0bd0654efb4a19f192a485d88daadbe8ee2f44c0;p=thirdparty%2FChart.js.git fix colour settings of BeforeLabel and BeforeBody (#4783) * fix colour settings of BeforeLabel and BeforeBody * delete redundant variable declaration * collect label colour setting. --- diff --git a/src/core/core.tooltip.js b/src/core/core.tooltip.js index 048e1a08a..2acd31e05 100644 --- a/src/core/core.tooltip.js +++ b/src/core/core.tooltip.js @@ -677,6 +677,7 @@ module.exports = function(Chart) { }; // Before body lines + ctx.fillStyle = mergeOpacity(vm.bodyFontColor, opacity); helpers.each(vm.beforeBody, fillLineOfText); var drawColorBoxes = vm.displayColors; @@ -684,6 +685,8 @@ module.exports = function(Chart) { // Draw body lines now helpers.each(body, function(bodyItem, i) { + var textColor = mergeOpacity(vm.labelTextColors[i], opacity); + ctx.fillStyle = textColor; helpers.each(bodyItem.before, fillLineOfText); helpers.each(bodyItem.lines, function(line) { @@ -701,7 +704,6 @@ module.exports = function(Chart) { // Inner square ctx.fillStyle = mergeOpacity(vm.labelColors[i].backgroundColor, opacity); ctx.fillRect(pt.x + 1, pt.y + 1, bodyFontSize - 2, bodyFontSize - 2); - var textColor = mergeOpacity(vm.labelTextColors[i], opacity); ctx.fillStyle = textColor; }