From 610524ab9ba9eb6e31f1d4d12b5aed1f3dbe7334 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Sun, 1 Mar 2020 12:56:41 -0800 Subject: [PATCH] include a preceeding data point so that lines that are off the graph draw more nicely.. --- root/js/solardash.file.jspp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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,