Only underline clickable legend items in pie charts

Signed-off-by: yubiuser <github@yubiuser.dev>
This commit is contained in:
yubiuser
2025-06-25 20:17:52 +02:00
parent 353ba2f163
commit a89fdda77e
2 changed files with 4 additions and 3 deletions

View File

@@ -91,17 +91,18 @@ globalThis.htmlLegendPlugin = {
if (isQueryTypeChart || isForwardDestinationChart) {
// Text (link to query log page)
link.title = `List ${item.text} queries`;
link.className = "legend-label-text clickable";
if (isQueryTypeChart) {
link.href = `queries?type=${item.text}`;
} else if (isForwardDestinationChart) {
// Encode the forward destination as it may contain an "#" character
link.href = `queries?upstream=${encodeURIComponent(upstreams[item.text])}`;
}
} else {
link.className = "legend-label-text";
}
link.style.textDecoration = item.hidden ? "line-through" : "";
link.className = "legend-label-text";
link.textContent = item.text;
li.append(boxSpan, link);