summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/pie_series.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-04-01 11:58:09 +0900
committerRandy Morgan <[email protected]>2012-04-01 11:58:09 +0900
commit1529fce32449a8454208fded20d83c9ceca810e0 (patch)
tree02f722182fea58a51b8c0a5433221b3a677e80e4 /lib/axlsx/drawing/pie_series.rb
parent22a341841f191a5aa00e87b1f166b4f25cc67f0a (diff)
downloadcaxlsx-1529fce32449a8454208fded20d83c9ceca810e0.tar.gz
caxlsx-1529fce32449a8454208fded20d83c9ceca810e0.zip
rebuild all serialization to use string concatenation instead of nokogiri.
Diffstat (limited to 'lib/axlsx/drawing/pie_series.rb')
-rw-r--r--lib/axlsx/drawing/pie_series.rb25
1 files changed, 12 insertions, 13 deletions
diff --git a/lib/axlsx/drawing/pie_series.rb b/lib/axlsx/drawing/pie_series.rb
index 8e583806..bf61c9ab 100644
--- a/lib/axlsx/drawing/pie_series.rb
+++ b/lib/axlsx/drawing/pie_series.rb
@@ -6,7 +6,7 @@ module Axlsx
# @see Chart#add_series
class PieSeries < Series
- # The data for this series.
+ # The data for this series.
# @return [SimpleTypedList]
attr_reader :data
@@ -29,22 +29,21 @@ module Axlsx
super(chart, options)
self.labels = CatAxisData.new(options[:labels]) unless options[:labels].nil?
self.data = ValAxisData.new(options[:data]) unless options[:data].nil?
- end
-
+ end
+
# @see explosion
def explosion=(v) Axlsx::validate_unsigned_int(v); @explosion = v; end
- # Serializes the series
- # @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_inner|
- xml_inner.explosion :val=>@explosion unless @explosion.nil?
- @labels.to_xml(xml_inner) unless @labels.nil?
- @data.to_xml(xml_inner) unless @data.nil?
- end
+ def to_xml_string(str = '')
+ super(str) do |str_inner|
+ str_inner << '<c:explosion val="' << @explosion << '"/>' unless @explosion.nil?
+ @labels.to_xml_string str_inner unless @labels.nil?
+ @data.to_xml_string str_inner unless @data.nil?
+ end
+ str
end
- private
+
+ private
# assigns the data for this series
def data=(v) DataTypeValidator.validate "Series.data", [SimpleTypedList], v; @data = v; end