modules/admin-full: reverse time labels in realtime stats (#386)
[project/luci.git] / modules / admin-full / luasrc / view / admin_status / wireless.htm
index 006cee7011f8786a6a85af5e34f02765a25041ee..15243631838e3f982f80b472d3d9e633c5b715d8 100644 (file)
@@ -139,7 +139,7 @@ $Id$
 
 
                                /* plot horizontal time interval lines */
-                               for (var i = step * 60; i < width; i += step * 60)
+                               for (var i = width % (step * 60); i < width; i += step * 60)
                                {
                                        var line = G.createElementNS('http://www.w3.org/2000/svg', 'line');
                                                line.setAttribute('x1', i);
@@ -152,7 +152,7 @@ $Id$
                                                text.setAttribute('x', i + 5);
                                                text.setAttribute('y', 15);
                                                text.setAttribute('style', 'fill:#999999; font-size:9pt');
-                                               text.appendChild(G.createTextNode(Math.round(i / step / 60) + 'm'));
+                                               text.appendChild(G.createTextNode(Math.round((width - i) / step / 60) + 'm'));
 
                                        label_25.parentNode.appendChild(line);
                                        label_25.parentNode.appendChild(text);
@@ -169,7 +169,7 @@ $Id$
                                                text2.setAttribute('x', i + 5);
                                                text2.setAttribute('y', 15);
                                                text2.setAttribute('style', 'fill:#999999; font-size:9pt');
-                                               text2.appendChild(G.createTextNode(Math.round(i / step / 60) + 'm'));
+                                               text2.appendChild(G.createTextNode(Math.round((width - i) / step / 60) + 'm'));
 
                                        label_25_2.parentNode.appendChild(line2);
                                        label_25_2.parentNode.appendChild(text2);