From a86c53236dff56035e83aea98af782a243c1c80a Mon Sep 17 00:00:00 2001 From: jamespcole Date: Sat, 4 Apr 2015 17:55:30 +1100 Subject: [PATCH] refactored line chart to be more efficient --- .../www_static/polymer/components/state-timeline.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/frontend/www_static/polymer/components/state-timeline.html b/homeassistant/components/frontend/www_static/polymer/components/state-timeline.html index 197e599dd75..506839820ab 100644 --- a/homeassistant/components/frontend/www_static/polymer/components/state-timeline.html +++ b/homeassistant/components/frontend/www_static/polymer/components/state-timeline.html @@ -180,12 +180,16 @@ var currentDate = new Date(prevDate); currentDate.setMinutes(prevDate.getMinutes() + 1); if(currentDate >= times[timeIndex] && timeIndex < times.length) { + //this is so we don't get jumps in the graph + var beforePoint = new Date(times[timeIndex]); + beforePoint.setSeconds(times[timeIndex].getSeconds() - 1) + data.push([beforePoint].concat(empty)); data.push([times[timeIndex]].concat(empty)); timeIndex++; } - else { - data.push([currentDate].concat(empty)); - } + //else { + //data.push([currentDate].concat(empty)); + //} prevDate = currentDate; }