lib/axlsx/drawing/pie_3D_chart.rb in axlsx-1.0.18 vs lib/axlsx/drawing/pie_3D_chart.rb in axlsx-1.1.0

- old
+ new

@@ -9,11 +9,11 @@ class Pie3DChart < Chart # Creates a new pie chart object # @param [GraphicFrame] frame The workbook that owns this chart. # @option options [Cell, String] title - # @option options [Boolean] show_legend + # @option options [Boolean] show_legend # @option options [Symbol] grouping # @option options [String] gapDepth # @option options [Integer] rotX # @option options [String] hPercent # @option options [Integer] rotY @@ -26,17 +26,19 @@ super(frame, options) @series_type = PieSeries @view3D = View3D.new({:rotX=>30, :perspective=>30}.merge(options)) end - # Serializes the pie chart + # Serializes the object + # @param [String] str # @return [String] - def to_xml - super() do |xml| - xml[:c].pie3DChart { - xml[:c].varyColors :val=>1 - @series.each { |ser| ser.to_xml(xml) } - } + def to_xml_string(str = '') + super(str) do |str_inner| + str_inner << '<c:pie3DChart>' + str_inner << '<c:varyColors val="1"/>' + @series.each { |ser| ser.to_xml_string(str_inner) } + str_inner << '</c:pie3DChart>' end end + end end