diff --git a/packages/grafana-ui/src/components/VizLegend/VizLegendTable.tsx b/packages/grafana-ui/src/components/VizLegend/VizLegendTable.tsx index 01e07e71e56..a8c29c7d10e 100644 --- a/packages/grafana-ui/src/components/VizLegend/VizLegendTable.tsx +++ b/packages/grafana-ui/src/components/VizLegend/VizLegendTable.tsx @@ -53,7 +53,10 @@ export const VizLegendTable = ({ 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; },