From 264bc15091ce76e94ceb0c0d741a312e54413e12 Mon Sep 17 00:00:00 2001 From: jamespcole Date: Sun, 5 Apr 2015 02:11:27 +1000 Subject: [PATCH] Fixed the line charts --- .../polymer/components/state-timeline.html | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 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 5a842a8c36b..07b6bc1b11d 100644 --- a/homeassistant/components/frontend/www_static/polymer/components/state-timeline.html +++ b/homeassistant/components/frontend/www_static/polymer/components/state-timeline.html @@ -200,22 +200,22 @@ var timeIndex = 1; var endDate = new Date(); var prevDate = times[0]; - data.push([times[0]].concat(empty)); - while(prevDate < endDate) { + //data.push([times[0]].concat(empty)); + for(var i = 0; i < times.length; i++) { var currentDate = new Date(prevDate); - currentDate.setMinutes(prevDate.getMinutes() + 1); - if(currentDate >= times[timeIndex] && timeIndex < times.length) { + //currentDate.setMinutes(prevDate.getMinutes() + 1); + //if(currentDate >= times[timeIndex] && timeIndex < times.length) { - var beforePoint = new Date(times[timeIndex]); + var beforePoint = new Date(times[i]); data.push([beforePoint].concat(empty)); - data.push([times[timeIndex]].concat(empty)); - prevDate = times[timeIndex]; + data.push([times[i]].concat(empty)); + prevDate = times[i]; timeIndex++; - } - else { - prevDate = currentDate; - } + //} + //else { + //prevDate = currentDate; + //} }