mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
refactored line chart to be more efficient
This commit is contained in:
parent
2576659923
commit
a86c53236d
@ -180,12 +180,16 @@
|
|||||||
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) {
|
||||||
|
//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));
|
data.push([times[timeIndex]].concat(empty));
|
||||||
timeIndex++;
|
timeIndex++;
|
||||||
}
|
}
|
||||||
else {
|
//else {
|
||||||
data.push([currentDate].concat(empty));
|
//data.push([currentDate].concat(empty));
|
||||||
}
|
//}
|
||||||
|
|
||||||
prevDate = currentDate;
|
prevDate = currentDate;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user