Class: Axlsx::Pie3DChart

Inherits:
Chart
  • Object
show all
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.

See Also:

Instance Attribute Summary

Attributes inherited from Chart

#graphic_frame, #series, #series_type, #show_legend, #style, #title, #view3D

Instance Method Summary collapse

Methods inherited from Chart

#add_series, #end_at, #from, #index, #pn, #start_at, #to

Constructor Details

#initialize(frame, options = {}) ⇒ Pie3DChart

Creates a new pie chart object

Parameters:

  • frame (GraphicFrame)

    The workbook that owns this chart.

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • title (Cell, String)
  • show_legend (Boolean)
  • grouping (Symbol)
  • gapDepth (String)
  • rotX (Integer)
  • hPercent (String)
  • rotY (Integer)
  • depthPercent (String)
  • rAngAx (Boolean)
  • perspective (Integer)

See Also:



25
26
27
28
29
# File 'lib/axlsx/drawing/pie_3D_chart.rb', line 25

def initialize(frame, options={})
  super(frame, options)
  @series_type = PieSeries
  @view3D = View3D.new({:rotX=>30, :perspective=>30}.merge(options))
end

Instance Method Details

#to_xml_string(str = '') ⇒ String

Serializes the object

Parameters:

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

Returns:

  • (String)


34
35
36
37
38
39
40
41
# File 'lib/axlsx/drawing/pie_3D_chart.rb', line 34

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