<% # Requires these locals: name, bar_color, background_color max = bar_graph_items.max if max && max > 0 # Try scaling, as sparklines have stopped working with large numbers # Also, scaling will put smaller numbers in the sparkline URL height = 40 scale = height.to_f/max values = bar_graph_items.collect {|v| (v*scale).round} -%> <%= name %>: <%= sparkline_tag values, :type => 'bar', :height => height, :upper => 0, :above_color => bar_color, :background_color => background_color %> (max = <%= max %>) <% end -%>