Skip to content

Commit e60e076

Browse files
committed
Make it possible to disable has_last when labeled.
1 parent d13d2ea commit e60e076

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/sparklines.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def plot_to_image(data=[], options={})
106106

107107
:has_min => false,
108108
:has_max => false,
109-
:has_last => false,
109+
:has_last => nil,
110110
:has_std_dev => false,
111111

112112
:label => nil
@@ -689,7 +689,9 @@ def create_canvas(w, h, bkg_col)
689689

690690
# Make room for label and last value
691691
unless @options[:label].nil?
692-
@options[:has_last] = true
692+
if (@options[:has_last].nil?)
693+
@options[:has_last] = true
694+
end
693695
@label_width = calculate_width(@options[:label])
694696
@data_last_width = calculate_width(@data.last)
695697
# HACK The 7.0 is a severe hack. Must figure out correct spacing

0 commit comments

Comments
 (0)