Skip to content

Commit

Permalink
fix colour settings of BeforeLabel and BeforeBody (#4783)
Browse files Browse the repository at this point in the history
* fix colour settings of BeforeLabel and BeforeBody

* delete redundant variable declaration

* collect label colour setting.
  • Loading branch information
Rittyan authored and etimberg committed Oct 2, 2017
1 parent b4d6924 commit 0bd0654
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/core.tooltip.js
Expand Up @@ -677,13 +677,16 @@ module.exports = function(Chart) {
};

// Before body lines
ctx.fillStyle = mergeOpacity(vm.bodyFontColor, opacity);
helpers.each(vm.beforeBody, fillLineOfText);

var drawColorBoxes = vm.displayColors;
xLinePadding = drawColorBoxes ? (bodyFontSize + 2) : 0;

// 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) {
Expand All @@ -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;
}

Expand Down

0 comments on commit 0bd0654

Please sign in to comment.