<% max_total = @hosts.inject(0) {|m,a| a['total'].to_i > m ? a['total'].to_i : m }%>

<% i=1; @hosts.each do |host|width=((host.total.to_f/max_total)*200).round; width = 1 if width < 1 %> <% i+=1; end %>
# Hits Hostname Percentage
<%= i %> <%= host.total %> <%= link_to host.ip, "http://cqcounter.com/whois/?query=#{host.ip}", :target=>'_blank' %> <%= sprintf("%000.2f",(host.total.to_f/@total_hits)*100) %>% <%=image_tag 'sitealizer/bar.gif', :width => width, :height => 3%>