charts.js: refactor to reduce complexity, improve readability and performance

Also

* drop jQuery usage
* move inline styles to CSS when possible
* switch to `a` tags for links otherwise use `p`

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
XhmikosR
2025-03-23 21:51:09 +02:00
parent 5a950a6c2d
commit 0fa650d9bb
2 changed files with 241 additions and 217 deletions

View File

@@ -261,15 +261,27 @@ td.lookatme {
align-self: center;
}
.chart-legend ul {
display: flex;
flex-direction: column;
flex-wrap: wrap;
margin: 0;
padding: 0;
}
.chart-legend li {
cursor: pointer;
position: relative;
line-height: 1;
margin: 0 0 8px;
align-items: center;
display: flex;
flex-direction: row;
}
.chart-legend li span {
cursor: pointer;
display: inline-block;
margin: 0 10px;
}
.colorBoxWrapper {
@@ -281,11 +293,14 @@ td.lookatme {
}
.chart-legend li .legend-label-text {
color: inherit;
margin: 0;
padding: 0;
line-height: 1;
word-break: break-word;
}
.chart-legend li .legend-label-text:hover {
.chart-legend li a.legend-label-text:hover {
text-decoration: underline;
}