Skip to content

Commit

Permalink
Add API for burndown chart
Browse files Browse the repository at this point in the history
Refs #4220

Used by the dev dashboard.
  • Loading branch information
Rudolfs Osins authored and maser committed Feb 17, 2012
1 parent 609d11f commit 4e9f62a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/controllers/rb_burndown_charts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,23 @@ class RbBurndownChartsController < RbApplicationController

def show
@burndown = @sprint.burndown

@dash = {
:data => [ {:label => "committed",
:data => @burndown.points_committed.each_with_index.map{ |p, i| [i + 1, p] }},
{:label => "remaining",
:data => @burndown.points_to_resolve.each_with_index.map{ |p, i| [i + 1, p] }},
{:label => "ideal",
:data => @burndown.ideal.each_with_index.map{ |p, i| [i + 1, p] }} ],
:options => { :xaxis => {:ticks => @burndown.days.each_with_index.map{ |d, i| [i + 1, d.strftime("%a")] },
:show => true,
:min => 1,
:max => @burndown.days.size},
:yaxis => { :min => 0 },
:legend => {:position => "sw"} } }

respond_to do |format|
format.html { render :layout => false }
format.json { render :json => @dash.to_json }
end
end

Expand Down

0 comments on commit 4e9f62a

Please sign in to comment.