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
#end_at, #graphic_frame, #index, #pn, #series, #series_type, #show_legend, #start_at, #title, #view3D
Instance Method Summary collapse
-
#initialize(workbook, options = {}) ⇒ Pie3DChart
constructor
Creates a new pie chart object.
-
#to_xml ⇒ String
Serializes the pie chart.
Methods inherited from Chart
Constructor Details
#initialize(workbook, options = {}) ⇒ Pie3DChart
Creates a new pie chart object
41 42 43 44 45 46 |
# File 'lib/axlsx/drawing/pie_3D_chart.rb', line 41 def initialize(workbook, ={}) super(workbook, ) # this charts series type @series_type = PieSeries @view3D = View3D.new(:rotX => 30, :perspective => 30) end |
Instance Method Details
#to_xml ⇒ String
Serializes the pie chart
50 51 52 53 54 55 56 57 |
# File 'lib/axlsx/drawing/pie_3D_chart.rb', line 50 def to_xml super() do |xml| xml.send('c:pie3DChart') { xml.send('c:varyColors', :val=>1) @series.each { |ser| ser.to_xml(xml) } } end end |