@@ -157,12 +157,17 private | |||||
157 | def graph_commits_per_author(repository) |
|
157 | def graph_commits_per_author(repository) | |
158 | commits_by_author = repository.changesets.count(:all, :group => :committer) |
|
158 | commits_by_author = repository.changesets.count(:all, :group => :committer) | |
159 | commits_by_author.sort! {|x, y| x.last <=> y.last} |
|
159 | commits_by_author.sort! {|x, y| x.last <=> y.last} | |
|
160 | ||||
|
161 | changes_by_author = repository.changes.count(:all, :group => :committer) | |||
|
162 | h = changes_by_author.inject({}) {|o, i| o[i.first] = i.last; o} | |||
160 |
|
163 | |||
161 | fields = commits_by_author.collect {|r| r.first} |
|
164 | fields = commits_by_author.collect {|r| r.first} | |
162 | data = commits_by_author.collect {|r| r.last} |
|
165 | commits_data = commits_by_author.collect {|r| r.last} | |
|
166 | changes_data = commits_by_author.collect {|r| h[r.first] || 0} | |||
163 |
|
167 | |||
164 | fields = fields + [""]*(10 - fields.length) if fields.length<10 |
|
168 | fields = fields + [""]*(10 - fields.length) if fields.length<10 | |
165 | data = data + [0]*(10 - data.length) if data.length<10 |
|
169 | commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10 | |
|
170 | changes_data = changes_data + [0]*(10 - changes_data.length) if changes_data.length<10 | |||
166 |
|
171 | |||
167 | graph = SVG::Graph::BarHorizontal.new( |
|
172 | graph = SVG::Graph::BarHorizontal.new( | |
168 | :height => 300, |
|
173 | :height => 300, | |
@@ -177,10 +182,15 private | |||||
177 | ) |
|
182 | ) | |
178 |
|
183 | |||
179 | graph.add_data( |
|
184 | graph.add_data( | |
180 | :data => data, |
|
185 | :data => commits_data, | |
181 | :title => l(:label_revision_plural) |
|
186 | :title => l(:label_revision_plural) | |
182 | ) |
|
187 | ) | |
183 |
|
188 | |||
|
189 | graph.add_data( | |||
|
190 | :data => changes_data, | |||
|
191 | :title => l(:label_change_plural) | |||
|
192 | ) | |||
|
193 | ||||
184 | graph.burn |
|
194 | graph.burn | |
185 | end |
|
195 | end | |
186 |
|
196 |
General Comments 0
You need to be logged in to leave comments.
Login now