luci-app-statistics: fix data source ordering
authorJo-Philipp Wich <jo@mein.io>
Thu, 20 Feb 2020 12:48:00 +0000 (13:48 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 20 Feb 2020 12:48:20 +0000 (13:48 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js

index fb3eeebd9ba47f7f0ca3697b129894ff842146f3..7949886f4ee34bea55fbb79f777d2f7539742aa4 100644 (file)
@@ -369,7 +369,7 @@ return L.Class.extend({
                        /* is first source in stack or overlay source: source_stk = source_nnl */
                        if (prev == null || source.overlay) {
                                /* create cdef statement for cumulative stack (no NaNs) and also
-                   for display (preserving NaN where no points should be displayed) */
+                                  for display (preserving NaN where no points should be displayed) */
                                if (gopts.rrasingle || !gopts.rramax)
                                        _args.push(
                                                'CDEF:%s_stk=%s_nnl'.format(source.sname, source.sname),
@@ -634,7 +634,7 @@ return L.Class.extend({
                                var x = a.weight || a.index || 0,
                                    y = b.weight || b.index || 0;
 
-                               return +x < +y;
+                               return +x - +y;
                        });
 
                        /* define colors in order */