Method: Axlsx::PieSeries#initialize

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

#initialize(chart, options = {}) ⇒ PieSeries

Creates a new series

Parameters:

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

    a customizable set of options

Options Hash (options):

  • data (Array, SimpleTypedList)
  • labels (Array, SimpleTypedList)
  • title (String)
  • explosion (Integer)


31
32
33
34
35
36
37
# File 'lib/axlsx/drawing/pie_series.rb', line 31

def initialize(chart, options={})
  @explosion = nil
  @colors = []
  super(chart, options)
  self.labels = AxDataSource.new(:data => options[:labels]) unless options[:labels].nil?
  self.data = NumDataSource.new(options) unless options[:data].nil?
end