mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Fixed the line charts
This commit is contained in:
parent
b6e880ed73
commit
264bc15091
@ -200,22 +200,22 @@
|
|||||||
var timeIndex = 1;
|
var timeIndex = 1;
|
||||||
var endDate = new Date();
|
var endDate = new Date();
|
||||||
var prevDate = times[0];
|
var prevDate = times[0];
|
||||||
data.push([times[0]].concat(empty));
|
//data.push([times[0]].concat(empty));
|
||||||
while(prevDate < endDate) {
|
for(var i = 0; i < times.length; i++) {
|
||||||
var currentDate = new Date(prevDate);
|
var currentDate = new Date(prevDate);
|
||||||
currentDate.setMinutes(prevDate.getMinutes() + 1);
|
//currentDate.setMinutes(prevDate.getMinutes() + 1);
|
||||||
if(currentDate >= times[timeIndex] && timeIndex < times.length) {
|
//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([beforePoint].concat(empty));
|
||||||
|
|
||||||
data.push([times[timeIndex]].concat(empty));
|
data.push([times[i]].concat(empty));
|
||||||
prevDate = times[timeIndex];
|
prevDate = times[i];
|
||||||
timeIndex++;
|
timeIndex++;
|
||||||
}
|
//}
|
||||||
else {
|
//else {
|
||||||
prevDate = currentDate;
|
//prevDate = currentDate;
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user