Class: Axlsx::Pie3DChart
- Defined in:
- lib/axlsx/drawing/pie_3D_chart.rb
Overview
The Pie3DChart is a three dimentional piechart (who would have guessed?) that you can add to your worksheet.
Instance Attribute Summary
Attributes inherited from Chart
#display_blanks_as, #graphic_frame, #series, #series_type, #show_legend, #style, #title, #vary_colors, #view_3D
Instance Method Summary collapse
-
#initialize(frame, options = {}) ⇒ Pie3DChart
constructor
Creates a new pie chart object.
-
#to_xml_string(str = '') ⇒ String
Serializes the object.
Methods inherited from Chart
#add_series, #d_lbls, #end_at, #from, #index, #pn, #relationship, #start_at, #to
Methods included from OptionsParser
Constructor Details
#initialize(frame, options = {}) ⇒ Pie3DChart
Creates a new pie chart object
25 26 27 28 29 30 31 |
# File 'lib/axlsx/drawing/pie_3D_chart.rb', line 25 def initialize(frame, ={}) @vary_colors = true super(frame, ) @series_type = PieSeries @view_3D = View3D.new({:rot_x =>30, :perspective=>30}.merge()) @d_lbls = nil end |
Instance Method Details
#to_xml_string(str = '') ⇒ String
Serializes the object
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/axlsx/drawing/pie_3D_chart.rb', line 36 def to_xml_string(str = '') super(str) do |str_inner| str_inner << '<c:pie3DChart>' str_inner << '<c:varyColors val="' << vary_colors.to_s << '"/>' @series.each { |ser| ser.to_xml_string(str_inner) } d_lbls.to_xml_string(str) if @d_lbls str_inner << '</c:pie3DChart>' end end |