Commit 1293fcad by Patrick O'Carroll Committed by Torkel Ödegaard

added an if to check for null to sort null as 0 (#10961)

* added an if to check for null to sort null as 0

* changed 0 to -Infinity
parent 7d0c3ae6
...@@ -151,7 +151,11 @@ module.directive('graphLegend', function(popoverSrv, $timeout) { ...@@ -151,7 +151,11 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
if (panel.legend.sort) { if (panel.legend.sort) {
seriesList = _.sortBy(seriesList, function(series) { seriesList = _.sortBy(seriesList, function(series) {
return series.stats[panel.legend.sort]; let sort = series.stats[panel.legend.sort];
if (sort === null) {
sort = -Infinity;
}
return sort;
}); });
if (panel.legend.sortDesc) { if (panel.legend.sortDesc) {
seriesList = seriesList.reverse(); seriesList = seriesList.reverse();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment