Only show the first 5 graph lines in tooltip
This commit is contained in:
@@ -55,11 +55,13 @@ function renderTooltip(context) {
|
||||
bodyLines.sort((a, b) => {
|
||||
return b.value - a.value;
|
||||
});
|
||||
bodyLines.forEach((body, i) => {
|
||||
bodyLines.slice(0, 5).forEach((body, i) => {
|
||||
const colors = labelColors[i];
|
||||
innerHtml += `<div style="color: ${colors.borderColor}" class="graphs-tooltip-item">${body}</div>`;
|
||||
});
|
||||
|
||||
if (bodyLines.length > 5) innerHtml += '<div>...</div>';
|
||||
|
||||
tooltipElem.value.innerHTML = innerHtml;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user