Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added no_data_message_font_size option

  • Loading branch information...
commit 4048df489ff3ac4f59afca24eb1329a9cee6e3ea 1 parent 4d4e0f4
stan Mazurek authored

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  lib/gruff/base.rb
6  lib/gruff/base.rb
@@ -134,6 +134,9 @@ class Base
134 134
     # Message shown when there is no data. Fits up to 20 characters. Defaults
135 135
     # to "No Data."
136 136
     attr_accessor :no_data_message
  137
+    
  138
+    # The font size of the no data message. Defaults to 20
  139
+    attr_accessor :no_data_message_font_size
137 140
 
138 141
     # The font size of the large title at the top of the graph
139 142
     attr_accessor :title_font_size
@@ -250,6 +253,7 @@ def initialize_ivars
250 253
       @legend_box_size = 20.0
251 254
 
252 255
       @no_data_message = "No Data"
  256
+      @no_data_message_font_size = 20
253 257
 
254 258
       @hide_line_markers = @hide_legend = @hide_title = @hide_line_numbers = @show_labels_for_bar_values = false
255 259
       @center_labels_over_point = true
@@ -776,7 +780,7 @@ def draw_no_data
776 780
       @d.font = @font if @font
777 781
       @d.stroke('transparent')
778 782
       @d.font_weight = NormalWeight
779  
-      @d.pointsize = scale_fontsize(80)
  783
+      @d.pointsize = scale_fontsize(@no_data_message_font_size)
780 784
       @d.gravity = CenterGravity
781 785
       @d = @d.annotate_scaled( @base_image,
782 786
                                @raw_columns, @raw_rows/2.0,

0 notes on commit 4048df4

Please sign in to comment.
Something went wrong with that request. Please try again.