Class: 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
-
#data ⇒ SimpleTypedList
readonly
The data for this series.
-
#explosion ⇒ Integert
The explosion for this series.
-
#labels ⇒ SimpleTypedList
readonly
The labels for this series.
Attributes inherited from Series
Instance Method Summary collapse
-
#initialize(chart, options = {}) ⇒ PieSeries
constructor
Creates a new series.
-
#to_xml(xml) ⇒ String
Serializes the series.
Methods inherited from Series
Constructor Details
#initialize(chart, options = {}) ⇒ PieSeries
Creates a new series
27 28 29 30 31 32 |
# File 'lib/axlsx/drawing/pie_series.rb', line 27 def initialize(chart, ={}) @explosion = nil super(chart, ) self.labels = CatAxisData.new([:labels]) unless [:labels].nil? self.data = ValAxisData.new([:data]) unless [:data].nil? end |
Instance Attribute Details
#data ⇒ SimpleTypedList
The data for this series.
11 12 13 |
# File 'lib/axlsx/drawing/pie_series.rb', line 11 def data @data end |
#explosion ⇒ Integert
The explosion for this series
19 20 21 |
# File 'lib/axlsx/drawing/pie_series.rb', line 19 def explosion @explosion end |
#labels ⇒ SimpleTypedList
The labels for this series.
15 16 17 |
# File 'lib/axlsx/drawing/pie_series.rb', line 15 def labels @labels end |
Instance Method Details
#to_xml(xml) ⇒ String
Serializes the series
40 41 42 43 44 45 46 |
# File 'lib/axlsx/drawing/pie_series.rb', line 40 def to_xml(xml) super(xml) do |xml_inner| xml_inner.explosion :val=>@explosion unless @explosion.nil? @labels.to_xml(xml_inner) unless @labels.nil? @data.to_xml(xml_inner) unless @data.nil? end end |