mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -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) {
|
if (item.getDisplayValues) {
|
||||||
const stat = item.getDisplayValues().filter((stat) => stat.title === sortKey)[0];
|
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;
|
return undefined;
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user