mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 11:10:12 +01:00
Simplufying interpolation method
This commit is contained in:
parent
3d2c048c44
commit
25bf820edc
1 changed files with 4 additions and 1 deletions
|
|
@ -41,10 +41,13 @@ class StatsController < ApplicationController
|
|||
end
|
||||
|
||||
def interpolate_avg_for_current_month(set)
|
||||
percent_of_month = Time.zone.now.day.to_f / Time.zone.now.end_of_month.day.to_f
|
||||
(set[0]*(1/percent_of_month) + set[1] + set[2]) / 3.0
|
||||
end
|
||||
|
||||
def percent_of_month
|
||||
Time.zone.now.day / Time.zone.now.end_of_month.day.to_f
|
||||
end
|
||||
|
||||
def actions_done_last_years
|
||||
@page_title = t('stats.index_title')
|
||||
@chart = Stats::Chart.new('actions_done_lastyears_data', :height => 400, :width => 900)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue