Commit 7a25e6d1 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

better trend calculation

parent b98b02f1
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -39,9 +39,9 @@
  def trend(item)
    times = @timelines[item].keys.sort

    ((@timelines[item][times.last] - 
    (@timelines[item][times.last] - 
    @timelines[item][times.first]) / 
      @timelines[item][times.first])
    @timelines[item][times.first]
  end

  def rank(item)
+1 −1
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ color:#000;
.ui_toplist .toplist_item .title{ float:left; line-height:42px; margin-left:20px; font-size:13px; color:#333; }
.ui_toplist .toplist_item .value{ float:right; line-height:42px; margin-right:20px; font-size:13px; font-weight:bold; color:#333; width:70px; color:#666; }
.ui_toplist .toplist_item .value.large{ width:110px; }
.ui_toplist .toplist_item .percent{ float:right; line-height:42px; margin-right:30px; font-size:18px; font-weight:bold; color:#333; width:110px; white-space:nowrap; }
.ui_toplist .toplist_item .percent{ float:right; line-height:42px; margin-right:30px; font-size:18px; font-weight:bold; color:#333; width:120px; white-space:nowrap; overflow:hidden; }

.ui_toplist .toplist_item .trend{ float:right; line-height:42px; margin-right:30px; font-size:18px; font-weight:bold; color:#333; width:70px; white-space:nowrap; }

+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@
        .number
          %span.desc Trend
          %span.value
            .ui_trend{:"data-trend" => @mmm_timeseries_arr[-1][-1][:avg].mean - @mmm_timeseries_arr[0][-1][:avg].mean  }
            .ui_trend{:"data-trend" => @mmm_timeseries_arr[0][-1][:avg].mean / (@mmm_timeseries_arr[-1][-1][:avg].mean - @mmm_timeseries_arr[0][-1][:avg].mean) }
        .number
          %span.desc Range
          %span.value.ui_value{:"data-value" => @values.range }