Permalink
Browse files

Added marker_shadow_color to allow to draw shadows below marker lines

  • Loading branch information...
1 parent cf1e090 commit 2706fad4a917981ff9cd8915f8d8b009ae9c643a @albertein albertein committed Sep 13, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/gruff/base.rb
View
@@ -152,6 +152,7 @@ class Base
# The color of the auxiliary lines
attr_accessor :marker_color
+ attr_accessor :marker_shadow_color
# The number of horizontal lines shown for reference
attr_accessor :marker_count
@@ -332,6 +333,7 @@ def theme=(options)
:colors => ['black', 'white'],
:additional_line_colors => [],
:marker_color => 'white',
+ :marker_shadow_color => nil,
:font_color => 'black',
:background_colors => nil,
:background_image => nil
@@ -340,6 +342,7 @@ def theme=(options)
@colors = @theme_options[:colors]
@marker_color = @theme_options[:marker_color]
+ @marker_shadow_color = @theme_options[:marker_shadow_color]
@font_color = @theme_options[:font_color] || @marker_color
@additional_line_colors = @theme_options[:additional_line_colors]
@@ -627,6 +630,11 @@ def draw_line_markers
@d = @d.fill(@marker_color)
@d = @d.line(@graph_left, y, @graph_right, y)
+ #If the user specified a marker shadow color, draw a shadow just below it
+ if not @marker_shadow_color.nil?
+ @d = @d.fill(@marker_shadow_color)
+ @d = @d.line(@graph_left, y + 1, @graph_right, y + 1)
+ end
marker_label = BigDecimal(index.to_s) * BigDecimal(@increment.to_s) +
BigDecimal(@minimum_value.to_s)

0 comments on commit 2706fad

Please sign in to comment.