Skip to content

Commit

Permalink
Make trendline always show latest value (#913)
Browse files Browse the repository at this point in the history
(newest datapoint 60 minutes old otherwise)

Signed-off-by: Thomas Knaller <[email protected]>
  • Loading branch information
tknaller authored and ghys committed Apr 18, 2021
1 parent 5515c8d commit 394d278
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ export default {
return this.$oh.api.get('/rest/persistence/items/' + this.config.trendItem).then((resp) => {
if (resp.data && resp.data.length) {
let data = []
for (let i = 0; i < resp.data.length; i += sampling) {
for (let i = resp.data.length - 1; i >= 0; i -= sampling) {
data.push(parseFloat(resp.data[i].state))
}
this.trendData = data
this.trendData = data.reverse()
this.showTrend = true
}
})
Expand Down

0 comments on commit 394d278

Please sign in to comment.