diff --git a/root/js/solardash.file.jspp b/root/js/solardash.file.jspp index f382e5b..d344666 100644 --- a/root/js/solardash.file.jspp +++ b/root/js/solardash.file.jspp @@ -35,8 +35,10 @@ WebSocketTest.prototype.send = function (s) { msg[2] = Infinity; var loidx, hiidx; loidx = fakedata.production.bisect([msg[1], 0]); - hiidx = fakedata.production.bisect([msg[2], 0]); - var subar = fakedata.production.slice(loidx, hiidx + 1); + if (loidx > 0) + loidx -= 1; + hiidx = fakedata.production.bisect([msg[2], 0]) + 1; + var subar = fakedata.production.slice(loidx, hiidx); var data = { "production": subar, "consumption": subar,