Skip to content
Browse files

fix

  • Loading branch information...
1 parent 517646d commit b7f0f03f4bb0b71811031610284d9978969d50c7 @wear wear committed
Showing with 8 additions and 9 deletions.
  1. +7 −8 app/views/forms/_chart.html.erb
  2. +1 −1 app/views/rows/_answer_sidebar.html.erb
View
15 app/views/forms/_chart.html.erb
@@ -1,18 +1,17 @@
<% if field.multi? %>
-<div class='span-16 prepend-top last'>
- <h4 style="text-align:left"><%= field.name %></h4>
+<div class='span-18 prepend-top last'>
+ <h3 style='text-align:left;'><%= field.name %></h3>
<section class="span-10">
<% data = field.options.map {|o| @form.klass.count({"f#{field.id}" => Regexp.new('(\s|^)' + o.value + '(\s|$)')})} %>
<% if field.options.length >= 5 %>
- <img src="<%= Gchart.bar(:data => data,:axis_with_labels => 'y,x',:axis_labels => [field.options.map{|f| truncate(f.value,:length => 14)},[0,data.max]],:orientation => 'horizontal',:bar_colors => random_color) %>" />
+ <img src="<%= Gchart.bar(:data => data,:axis_with_labels => 'x,y',:axis_labels => [[0,data.max],field.options.map{|f| truncate(f.value,:length => 14)}.reverse],:orientation => 'horizontal',:bar_colors => random_color) %>" />
<% else %>
<img src="<%= Gchart.pie(
:data => data, :labels => field.options.map(&:value),:bar_colors => random_color ) %>" />
- <% end %>
+ <% end %>
</section>
-
- <section class="span-6 last">
+ <section class="span-8 last">
<table class='grid' id='huizong' cellspacing="0" cellpadding="0">
<col width='40%'>
<col width='20%'>
@@ -26,9 +25,9 @@
<tbody>
<% field.options.each do |option| %>
<% option_count = @form.klass.count({"f#{field.id}" => Regexp.new('(\s|^)' + option.value + '(\s|$)')}) %>
- <% percentage = option_count * 100 / @form.rows_count %>
+ <%# percentage = option_count * 100 / @form.rows_count %>
<tr>
- <td><%= option.value %></td>
+ <td><%=option.value%><%#=link_to option.value,chart_form_path(@form,:filter => option) %></td>
<td><%= option_count %></td>
<% if false %>
<td style="text-align:left;">
View
2 app/views/rows/_answer_sidebar.html.erb
@@ -1,5 +1,5 @@
<div class='box'>
- <ul class='sidebar_nav'>
+ <ul class='sidebar_nav'>
<li class="<%= 'current' if @tab == 'answers' %>"><%=link_to t(:answers), form_rows_path(@form, :edit_key => @form.edit_key) %> </li>
<li class="<%= 'current' if @tab == 'chart' %>"><%= link_to t(:report), chart_form_path(@form)%></li>
<li class="<%= 'current' if @tab == 'stats' %>"><%= link_to t(:visits), stats_form_path(@form) %></li>

0 comments on commit b7f0f03

Please sign in to comment.
Something went wrong with that request. Please try again.