Dashlet Scatterplot add option to revers Tooltip
for the Dashlet Scatterplot add an Option to reverse the tooltip (Mouseover)
The only change is the addition of the argument reverse=True or false to the sorted() function
@classmethod
def _create_tooltip(
cls,
timestamp: int,
host_to_value_dict: Mapping[str, str],
additional_rows: Sequence[tuple[str, str]] | None = None,
) -> HTML:
# Werte absteigend sortieren (höchster Wert zuerst)
table_rows = sorted(host_to_value_dict.items(), key=lambda item: item[1], reverse=True)
table_rows.extend(additional_rows or [])
rows = []
for a, b in table_rows:
rows.append(HTMLWriter.render_tr(HTMLWriter.render_td(a) + HTMLWriter.render_td(b)))
return HTMLWriter.render_div(date_and_time(timestamp)) + HTMLWriter.render_table(
HTML.empty().join(rows)
)
Comments: 2
Oldest
•
Newest
•
Most likes
•
Fewest likes
-
17 Apr, '25
Mohamed Saleh AdminHi Bernd,
Thank you for posting your idea!
Could you give us a hint what is your use case for having the reverse tooltip? -
22 Apr, '25
Bernd Holzhaueractually quite simple ..... i have a scatterplot with about 25+ values and therefore have a rather large tooltip (biger than the screen) but would like to have the highest values immediately at the top of the list ... in other case you would have the lowest value on top
Greetz Bernd