Only show the first 5 graph lines in tooltip

This commit is contained in:
Johannes Zellner
2025-12-09 16:00:04 +01:00
parent b5c75caea0
commit 72970720d2
+3 -1
View File
@@ -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;
}