Adding widget to graph issue status changes
This commit is contained in:
parent
f45b0b67be
commit
ef19c23cc3
|
@ -10,7 +10,7 @@ class GraphsController < ApplicationController
|
|||
|
||||
helper IssuesHelper
|
||||
|
||||
def issue_status_flow
|
||||
def issue_status_flow_graph
|
||||
# Get the top visible projects by issue count
|
||||
sql = " select is1.id as old_status, is2.id as new_status, count(*) as changes_count"
|
||||
sql << " from journals as j"
|
||||
|
|
|
@ -7,12 +7,15 @@
|
|||
points = Hash.new
|
||||
i = -1
|
||||
@issue_statuses.each do |issue_status|
|
||||
points[issue_status.id] = {"x" => Math.sin(2*Math::PI*i/@issue_statuses.size)*100 + 150, "y" => Math.cos(2*Math::PI*i/@issue_statuses.size)*100 + 150}
|
||||
points[issue_status.id] = {
|
||||
"x" => Math.sin(2*Math::PI*i/@issue_statuses.size)*100 + 140,
|
||||
"y" => Math.cos(2*Math::PI*i/@issue_statuses.size)*100 + 125
|
||||
}
|
||||
i -= 1
|
||||
end
|
||||
%>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="300" height="300">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="280" height="270">
|
||||
<g fill-opacity="0.2" stroke-opacity="0.5">
|
||||
<% @status_changes.each do |status_change| %>
|
||||
<%
|
||||
|
@ -41,7 +44,7 @@
|
|||
/>
|
||||
<% end %>
|
||||
</g>
|
||||
<g fill="white" stroke="black" stroke-width="2" stroke-opacity="0.5">
|
||||
<g fill="#EEEEEE" stroke="black" stroke-width="1" stroke-opacity="0.75">
|
||||
<% points.each do |status_id, point| %>
|
||||
<circle cx="<%= point["x"] %>" cy="<%= point["y"] %>" r="35" />
|
||||
<% end %>
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
5
app/views/my/blocks/_issue_status_flow.html.erb
Normal file
5
app/views/my/blocks/_issue_status_flow.html.erb
Normal file
|
@ -0,0 +1,5 @@
|
|||
<h3><%= l(:label_graphs_issue_status_flow) %></h3>
|
||||
|
||||
<div style="text-align: center">
|
||||
<%= tag("embed", :width => "300", :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'graphs', :action => 'issue_status_flow_graph')) %>
|
||||
</div>
|
|
@ -3,4 +3,4 @@ en:
|
|||
label_graphs_total_vs_closed_issues: Total issues vs. Closed issues
|
||||
label_graphs_old_issues: Open aging issues
|
||||
label_graphs_issue_growth: Total issues over time
|
||||
|
||||
label_graphs_issue_status_flow: Recent status changes (within 24 hours)
|
||||
|
|
Loading…
Reference in New Issue
Block a user