mirror of
https://github.com/status-im/burnchart.git
synced 2025-01-19 15:12:05 +00:00
trendline not editing actual values
This commit is contained in:
parent
7d209034e3
commit
256eb5388b
@ -79,13 +79,13 @@ module.exports =
|
||||
'trendline': (actual, created_at, due_on) ->
|
||||
start = +actual[0].date
|
||||
|
||||
# Now is an actual point too.
|
||||
last = actual[actual.length - 1]
|
||||
actual.push { 'date': new Date(), 'points': last.points }
|
||||
|
||||
values = _.map actual, ({ date, points }) ->
|
||||
[ +date - start, points ]
|
||||
|
||||
# Now is an actual point too.
|
||||
last = actual[actual.length - 1]
|
||||
values.push [ + new Date() - start, last.points ]
|
||||
|
||||
b1 = 0 ; e = 0 ; c1 = 0
|
||||
a = (l = values.length) * _.reduce(values, (sum, [ a, b ]) ->
|
||||
b1 += a ; e += b
|
||||
|
Loading…
x
Reference in New Issue
Block a user