Permalink
Browse files

Graph: Improve overlapping hackfix

  • Loading branch information...
binarymaster committed Mar 5, 2018
1 parent 4da1986 commit b4a1e02d5a1c7b0414e02ab019fd11e2654a1084
Showing with 3 additions and 2 deletions.
  1. +3 −2 graph.html
View
@@ -12,7 +12,7 @@
recheckCoordsLock();
$.get('3wifi.php?a=loads', function(d)
{
var lo = 0, hi = 0, dt = 0;
var lo = 0, hi = 0, dt = 0, days = [];
if (!d.result)
{
$('#stat').text(errorStr(d.error));
@@ -24,7 +24,8 @@
dt = d.data[i][0].split('.');
if (lo == 0) lo = dt[0] + '.' + dt[1];
hi = dt[0] + '.' + dt[1];
if (d.data.length-i < 5) dt[2] += ' '; // dirty hack to prevent graph overlapping
if (days.indexOf(dt[2]) > -1) dt[2] += ' '; // hack to prevent graph overlapping
days.push(dt[2]);
d.data[i][0] = dt[2];
}
d.label = (lo == hi ? lo : lo + '-' + hi);

0 comments on commit b4a1e02

Please sign in to comment.