]> source.dussan.org Git - redmine.git/commitdiff
make height of "Commits per author" graph flexible (#1983, #13486)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 18 Apr 2013 02:07:44 +0000 (02:07 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 18 Apr 2013 02:07:44 +0000 (02:07 +0000)
Contributed by Max Horn.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11723 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/repositories_controller.rb
app/views/repositories/stats.html.erb

index a757df1549f1cdf0383b8a6091477b03979f11d7..2912b72bfab688bbef414645a47d468a26d530e1 100644 (file)
@@ -411,7 +411,7 @@ class RepositoriesController < ApplicationController
     fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') }
 
     graph = SVG::Graph::BarHorizontal.new(
-      :height => 400,
+      :height => 15 * commits_data.length,
       :width => 800,
       :fields => fields,
       :stack => :side,
index b9a5d7d6aeeae8f1de1737f2cbe7e1a9c5b3652e..5c20f05859b5fa49d62a2b72d44866d9ec165498 100644 (file)
@@ -1,10 +1,18 @@
 <h2><%= l(:label_statistics) %></h2>
 
 <p>
-<%= tag("embed", :width => 800, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %>
+<%= tag("embed", :width => 800, :height => params[:height_commits_per_month],
+        :type => "image/svg+xml", :src => url_for(:controller => 'repositories',
+        :action => 'graph', :id => @project,
+        :repository_id => @repository.identifier_param,
+        :graph => "commits_per_month")) %>
 </p>
 <p>
-<%= tag("embed", :width => 800, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_author")) %>
+<%= tag("embed", :width => 800, :height => params[:height_commits_per_author],
+        :type => "image/svg+xml", :src => url_for(:controller => 'repositories',
+        :action => 'graph', :id => @project,
+        :repository_id => @repository.identifier_param,
+        :graph => "commits_per_author")) %>
 </p>
 
 <p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>