Sha256: fbfa7e19480cac758aa7cd72c80afbcce19ddc52a987923a6dcbe3da92d15169

Contents?: true

Size: 1.22 KB

Versions: 6

Compression:

Stored size: 1.22 KB

Contents

module Axlsx


  # The Pie3DChart is a three dimentional piechart (who would have guessed?) that you can add to your worksheet.
  # @see Worksheet#add_chart
  # @see Chart#add_series
  # @see README for an example
  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 [Symbol] grouping
    # @option options [String] gapDepth
    # @option options [Integer] rotX
    # @option options [String] hPercent
    # @option options [Integer] rotY
    # @option options [String] depthPercent
    # @option options [Boolean] rAngAx
    # @option options [Integer] perspective
    # @see Chart
    # @see View3D
    def initialize(frame, options={})
      super(frame, options)
      @series_type = PieSeries
      @view3D = View3D.new({:rotX=>30, :perspective=>30}.merge(options))
    end

    # Serializes the pie chart
    # @return [String]
    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
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
axlsx-1.0.13 lib/axlsx/drawing/pie_3D_chart.rb
axlsx-1.0.11 lib/axlsx/drawing/pie_3D_chart.rb
axlsx-1.0.10 lib/axlsx/drawing/pie_3D_chart.rb
axlsx-1.0.10a lib/axlsx/drawing/pie_3D_chart.rb
axlsx-1.0.9 lib/axlsx/drawing/pie_3D_chart.rb
axlsx-1.0.8 lib/axlsx/drawing/pie_3D_chart.rb