Class: Axlsx::PieSeries
- Inherits:
-
Series
- Object
- Series
- Axlsx::PieSeries
- Defined in:
- lib/axlsx/drawing/pie_series.rb
Overview
Note:
The recommended way to manage series is to use Chart#add_series
A PieSeries defines the data and labels and explosion for pie charts series.
Instance Attribute Summary (collapse)
-
- (SimpleTypedList) data
The data for this series.
-
- (Integert) explosion
The explosion for this series.
-
- (SimpleTypedList) labels
The labels for this series.
Attributes inherited from Series
Instance Method Summary (collapse)
-
- (PieSeries) initialize(chart, options = {})
constructor
Creates a new series.
-
- (String) to_xml(xml)
Serializes the series.
Constructor Details
- (PieSeries) initialize(chart, options = {})
Creates a new series
26 27 28 29 30 |
# File 'lib/axlsx/drawing/pie_series.rb', line 26 def initialize(chart, ={}) super(chart, ) self.labels = CatAxisData.new([:labels]) unless [:labels].nil? self.data = ValAxisData.new([:data]) unless [:data].nil? end |
Instance Attribute Details
- (SimpleTypedList) data
The data for this series.
10 11 12 |
# File 'lib/axlsx/drawing/pie_series.rb', line 10 def data @data end |
- (Integert) explosion
The explosion for this series
18 19 20 |
# File 'lib/axlsx/drawing/pie_series.rb', line 18 def explosion @explosion end |
- (SimpleTypedList) labels
The labels for this series.
14 15 16 |
# File 'lib/axlsx/drawing/pie_series.rb', line 14 def labels @labels end |
Instance Method Details
- (String) to_xml(xml)
Serializes the series
37 38 39 40 41 42 43 |
# File 'lib/axlsx/drawing/pie_series.rb', line 37 def to_xml(xml) super(xml) do |xml| xml.send('c:explosion', :val=>@explosion) unless @explosion.nil? @labels.to_xml(xml) unless @labels.nil? @data.to_xml(xml) unless @data.nil? end end |