summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/bar_series.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2011-11-26 13:20:57 +0900
committerRandy Morgan <[email protected]>2011-11-26 13:20:57 +0900
commit11303a4d6664d9a7ff7bc408035d2ab70378a375 (patch)
tree51c675ae3ab8cd6c1afd7087145261b1eb2ec54c /lib/axlsx/drawing/bar_series.rb
parent044afe5a35db42cefce4f18a0fecc3da90cab1b5 (diff)
downloadcaxlsx-11303a4d6664d9a7ff7bc408035d2ab70378a375.tar.gz
caxlsx-11303a4d6664d9a7ff7bc408035d2ab70378a375.zip
adding in support for ruby 1.9.3
release version 1.0.9
Diffstat (limited to 'lib/axlsx/drawing/bar_series.rb')
-rw-r--r--lib/axlsx/drawing/bar_series.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/axlsx/drawing/bar_series.rb b/lib/axlsx/drawing/bar_series.rb
index c4bffa8c..129a13e8 100644
--- a/lib/axlsx/drawing/bar_series.rb
+++ b/lib/axlsx/drawing/bar_series.rb
@@ -17,7 +17,7 @@ module Axlsx
# The shabe of the bars or columns
# must be one of [:percentStacked, :clustered, :standard, :stacked]
# @return [Symbol]
- attr_accessor :shape
+ attr_reader :shape
# Creates a new series
# @option options [Array, SimpleTypedList] data
@@ -32,6 +32,8 @@ module Axlsx
self.data = ValAxisData.new(options[:data]) unless options[:data].nil?
end
+ # The shabe of the bars or columns
+ # must be one of [:percentStacked, :clustered, :standard, :stacked]
def shape=(v)
RestrictionValidator.validate "BarSeries.shape", [:cone, :coneToMax, :box, :cylinder, :pyramid, :pyramidToMax], v
@shape = v
@@ -41,10 +43,10 @@ module Axlsx
# @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to.
# @return [String]
def to_xml(xml)
- super(xml) do |xml|
- @labels.to_xml(xml) unless @labels.nil?
- @data.to_xml(xml) unless @data.nil?
- xml.send('c:shape', :val=>@shape)
+ super(xml) do |xml_inner|
+ @labels.to_xml(xml_inner) unless @labels.nil?
+ @data.to_xml(xml_inner) unless @data.nil?
+ xml_inner.send('c:shape', :val=>@shape)
end
end