mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
fix colour settings of BeforeLabel and BeforeBody (#4783)
* fix colour settings of BeforeLabel and BeforeBody * delete redundant variable declaration * collect label colour setting.
This commit is contained in:
parent
b4d69247b0
commit
0bd0654efb
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user