From bd5a1567f83286a319a35545a003b0d105ba3904 Mon Sep 17 00:00:00 2001 From: Brad Beattie Date: Tue, 10 Mar 2009 15:20:54 -0700 Subject: [PATCH] Smoothing the graph out a bit --- app/controllers/graphs_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/graphs_controller.rb b/app/controllers/graphs_controller.rb index 01bfa04..359c453 100755 --- a/app/controllers/graphs_controller.rb +++ b/app/controllers/graphs_controller.rb @@ -40,7 +40,8 @@ class GraphsController < ApplicationController issues_by_created_on = issues_by_project[project].group_by {|issue| issue.created_on.to_date }.sort created_count = 0 created_on_line = Hash.new - issues_by_created_on.each { |created_on, issues| created_on_line[(created_on-1).to_s] = created_count; created_count += issues.size; created_on_line[created_on.to_s] = created_count } + created_on_line[(issues_by_created_on.first[0]-1).to_s] = 0 + issues_by_created_on.each { |created_on, issues| created_count += issues.size; created_on_line[created_on.to_s] = created_count } created_on_line[Date.today.to_s] = created_count graph.add_data({ :data => created_on_line.sort.flatten,