<% if @statuses.empty? or rows.empty? %>

<%=l(:label_no_data)%>

<% else %> <% for status in @statuses %> <% end %> <% for row in rows %> <% for status in @statuses %> <% end %> <% end %>
<%= status.name %><%=l(:label_open_issues_plural)%> <%=l(:label_closed_issues_plural)%> <%=l(:label_total)%>
<%= link_to row.name, aggregate_path(@project, field_name, row, :subproject_id => nil) %><%= aggregate_link data, { field_name => row.id, "status_id" => status.id }, aggregate_path(@project, field_name, row, :status_id => status.id, :subproject_id => nil) %><%= aggregate_link data, { field_name => row.id, "closed" => 0 }, aggregate_path(@project, field_name, row, :status_id => "o", :subproject_id => nil) %> <%= aggregate_link data, { field_name => row.id, "closed" => 1 }, aggregate_path(@project, field_name, row, :status_id => "c", :subproject_id => nil) %> <%= aggregate_link data, { field_name => row.id }, aggregate_path(@project, field_name, row, :status_id => "*", :subproject_id => nil) %>
<% other_formats_links do |f| %> <%= f.link_to_with_query_parameters 'CSV', {}, :onclick => "showModal('csv-export-options', '330px'); return false;" %> <% end %>
<%= javascript_tag do %> function renderChart(canvas_id, title, chartData){ var backgroundColors = ['rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(255, 206, 86, 0.2)', 'rgba(75, 192, 192, 0.2)', 'rgba(153, 102, 255, 0.2)', 'rgba(255, 159, 64, 0.2)']; var borderColors = ['rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)', 'rgba(75, 192, 192, 1)', 'rgba(153, 102, 255, 1)', 'rgba(255, 159, 64, 1)']; for (var i = 0; i < chartData.datasets.length; i++) { chartData.datasets[i].backgroundColor = backgroundColors[i % backgroundColors.length]; chartData.datasets[i].borderColor = borderColors[i % borderColors.length]; chartData.datasets[i].borderWidth = 1; } new Chart($(canvas_id), { type: 'bar', data: chartData, options: { indexAxis: 'y', elements: { bar: {borderWidth: 2} }, responsive: true, plugins: { legend: {position: 'right'}, title: { display: true, text: title } }, scales: { yAxis: {stacked: true}, xAxis: {stacked: true, ticks: {precision: 0}} } } }); } $(document).ready(function(){ var chartData1 = { labels: <%= raw rows.collect{|row| row.name}.to_json %>, datasets: <%= raw @statuses.collect{|status| {"label" => status.name, "hidden" => status.is_closed?, "data" => rows.collect{|row| aggregate(data, {field_name => row.id, "status_id" => status.id})}}}.to_json %> }; var chartData2 = { labels: <%= raw @statuses.collect{|status| status.name}.to_json %>, datasets: <%= raw rows.collect{|row| {"label" => row.name, "data" => @statuses.collect{|status| aggregate(data, {field_name => row.id, "status_id" => status.id})}}}.to_json %> }; renderChart("#issues_by_<%= params[:detail] %>", "<%= l(:label_issues_by, @report_title) %>", chartData1); renderChart("#issues_by_status", "<%= l(:label_issues_by, l(:field_status)) %>", chartData2); }); <% end %> <% content_for :header_tags do %> <%= javascript_include_tag "chart.min" %> <% end %> <% end %>