summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/chart.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-10-14 11:28:02 +0900
committerRandy Morgan <[email protected]>2012-10-14 11:28:02 +0900
commite4d4538e1ea15b6aff9e4ef3fbc47c2e29ceb8be (patch)
tree92b9ef6e6a0d0329428e4ce1679cea6a0eff90e9 /lib/axlsx/drawing/chart.rb
parent9740fed4e0834c0fcdce8e07153b9b794525f37e (diff)
downloadcaxlsx-e4d4538e1ea15b6aff9e4ef3fbc47c2e29ceb8be.tar.gz
caxlsx-e4d4538e1ea15b6aff9e4ef3fbc47c2e29ceb8be.zip
Refactored to use options parser
Diffstat (limited to 'lib/axlsx/drawing/chart.rb')
-rw-r--r--lib/axlsx/drawing/chart.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/axlsx/drawing/chart.rb b/lib/axlsx/drawing/chart.rb
index 8566b3f3..35e2089a 100644
--- a/lib/axlsx/drawing/chart.rb
+++ b/lib/axlsx/drawing/chart.rb
@@ -6,6 +6,7 @@ module Axlsx
# @see README for examples
class Chart
+ include Axlsx::OptionsParser
# Creates a new chart object
# @param [GraphicalFrame] frame The frame that holds this chart.
# @option options [Cell, String] title
@@ -21,9 +22,7 @@ module Axlsx
@show_legend = true
@series_type = Series
@title = Title.new
- options.each do |o|
- self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
- end
+ parse_options options
start_at(*options[:start_at]) if options[:start_at]
end_at(*options[:end_at]) if options[:end_at]
yield self if block_given?