Method: Axlsx::PieSeries#to_xml_string

Defined in:
lib/axlsx/drawing/pie_series.rb

#to_xml_string(str = '') ⇒ String

Serializes the object

Parameters:

  • str (String) (defaults to: '')

Returns:



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/axlsx/drawing/pie_series.rb', line 48

def to_xml_string(str = '')
  super(str) do
    str << '<c:explosion val="' + @explosion + '"/>' unless @explosion.nil?
    colors.each_with_index do |c, index|
      str << '<c:dPt>'
      str << ('<c:idx val="' << index.to_s << '"/>')
      str << '<c:spPr><a:solidFill>'
      str << ('<a:srgbClr val="' << c << '"/>')
      str << '</a:solidFill></c:spPr></c:dPt>'
    end
    @labels.to_xml_string str unless @labels.nil?
    @data.to_xml_string str unless @data.nil?
  end
  str
end