<% unique_max_total = @daily_hits.inject(0) {|m,a| a[1].to_i > m ? a[1].to_i : m } hits_max_total = @daily_hits.inject(0) {|m,a| a[2].to_i > m ? a[2].to_i : m } %> <% @daily_hits.each do |daily_hits| unique_height = 0 hits_height = 0 if unique_max_total > 0 unique_height = ((daily_hits[1].to_f/unique_max_total)*100).round unique_height = 1 if unique_height < 1 end if hits_max_total > 0 hits_height = ((daily_hits[2].to_f/hits_max_total)*100).round hits_height = 1 if hits_height < 1 end %> <%end%>
Unique
Hits
<%=daily_hits[0]%>


<%i=1; @daily_hits.each do |daily_hits| %> <% i+=1; end %>
Day Hits Percentage Unique Visits
<%= daily_hits[3] %> <%= daily_hits[2] %> <%= sprintf("%000.2f",(daily_hits[2].to_f/@total_hits)*100) %>% <%= daily_hits[1] %>
Totals: <%=@total_hits%> <%=@unique_hits%>