mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
Legend: Fix desc sort so NaNs are not display first (#75685)
do not put NaNs as first in legend desc sort Co-authored-by: Simon Podlipsky <simon@podlipsky.net> Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
This commit is contained in:
parent
5b63cdb5b0
commit
a417402c77
@ -53,7 +53,10 @@ export const VizLegendTable = <T extends unknown>({
|
||||
|
||||
if (item.getDisplayValues) {
|
||||
const stat = item.getDisplayValues().filter((stat) => stat.title === sortKey)[0];
|
||||
return stat && stat.numeric;
|
||||
|
||||
if (stat) {
|
||||
return isNaN(stat.numeric) ? -Infinity : stat.numeric;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user