# File lib/scruffy/layers/sparkline_bar.rb, line 6 def draw(svg, coords, options = {}) zero_point = @height / 2.0 coords.each do |coord| x, y, bar_height = (coord.first-(@bar_width * 0.5)), coord.last, (height - coord.last) bar_color = (y > zero_point) ? 'black' : 'red' bar_height = (bar_height - zero_point) #y = (bar_height < 0) ? # svg.rect( :x => x, :y => zero_point, :width => @bar_width, :height => , # :fill => bar_color, :stroke => 'none', 'style' => "opacity: #{opacity}" ) end end