mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Show color box only on the first line of the tooltip body (#6984)
* Show color box only on the first line of the tooltip body * Code review feedback
This commit is contained in:
parent
b097fe43c9
commit
216ac70261
@ -788,12 +788,12 @@ class Tooltip extends Element {
|
||||
helpers.each(bodyItem.before, fillLineOfText);
|
||||
|
||||
lines = bodyItem.lines;
|
||||
for (j = 0, jlen = lines.length; j < jlen; ++j) {
|
||||
// Draw Legend-like boxes if needed
|
||||
if (displayColors) {
|
||||
me._drawColorBox(ctx, pt, i, rtlHelper);
|
||||
}
|
||||
// Draw Legend-like boxes if needed
|
||||
if (displayColors && lines.length) {
|
||||
me._drawColorBox(ctx, pt, i, rtlHelper);
|
||||
}
|
||||
|
||||
for (j = 0, jlen = lines.length; j < jlen; ++j) {
|
||||
fillLineOfText(lines[j]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user