lib/my_chartkick.rb in my_chartkick-0.1.1 vs lib/my_chartkick.rb in my_chartkick-0.1.2
- old
+ new
@@ -17,12 +17,13 @@
define_method "my_#{helper}" do |data, opt|
opt = opt.dup
data_set = DataSet.create data, opt
colorize! data_set, opt
merge_default_opt! opt
+ title = opt.delete :title
chart_block = send helper, data_set, opt
- return chart_block unless opt[:title]
- title_block(opt[:title]) + chart_block
+ return chart_block unless title
+ title_block(title) + chart_block
end
end
def colorize! data_set, opt
opt.merge!({colors: RandPalette.random(data_set.count, alpha: 0.8)}) if Array === data_set