Class: Axlsx::LineSeries
- Defined in:
- lib/axlsx/drawing/line_series.rb
Overview
Note:
The recommended way to manage series is to use Chart#add_series
A LineSeries defines the title, data and labels for line charts
Instance Attribute Summary collapse
-
#data ⇒ ValAxisData
readonly
The data for this series.
-
#labels ⇒ CatAxisData
readonly
The labels for this series.
Attributes inherited from Series
Instance Method Summary collapse
-
#initialize(chart, options = {}) ⇒ LineSeries
constructor
Creates a new series.
-
#to_xml(xml) ⇒ String
Serializes the series.
Methods inherited from Series
Constructor Details
#initialize(chart, options = {}) ⇒ LineSeries
Creates a new series
20 21 22 23 24 25 |
# File 'lib/axlsx/drawing/line_series.rb', line 20 def initialize(chart, ={}) @labels, @data = nil, nil super(chart, ) @labels = CatAxisData.new([:labels]) unless [:labels].nil? @data = ValAxisData.new([:data]) unless [:data].nil? end |
Instance Attribute Details
#data ⇒ ValAxisData
The data for this series.
10 11 12 |
# File 'lib/axlsx/drawing/line_series.rb', line 10 def data @data end |
#labels ⇒ CatAxisData
The labels for this series.
14 15 16 |
# File 'lib/axlsx/drawing/line_series.rb', line 14 def labels @labels end |
Instance Method Details
#to_xml(xml) ⇒ String
Serializes the series
30 31 32 33 34 35 |
# File 'lib/axlsx/drawing/line_series.rb', line 30 def to_xml(xml) super(xml) do |xml_inner| @labels.to_xml(xml_inner) unless @labels.nil? @data.to_xml(xml_inner) unless @data.nil? end end |