Class: Axlsx::LineSeries
- Inherits:
-
Series
- Object
- Series
- 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)
-
- (ValAxisData) data
The data for this series.
-
- (CatAxisData) labels
The labels for this series.
Attributes inherited from Series
Instance Method Summary (collapse)
-
- (LineSeries) initialize(chart, options = {})
constructor
Creates a new series.
-
- (String) to_xml(xml)
Serializes the series.
Constructor Details
- (LineSeries) initialize(chart, options = {})
Creates a new series
20 21 22 23 24 |
# File 'lib/axlsx/drawing/line_series.rb', line 20 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
- (ValAxisData) data
The data for this series.
10 11 12 |
# File 'lib/axlsx/drawing/line_series.rb', line 10 def data @data end |
- (CatAxisData) labels
The labels for this series.
14 15 16 |
# File 'lib/axlsx/drawing/line_series.rb', line 14 def labels @labels end |
Instance Method Details
- (String) to_xml(xml)
Serializes the series
29 30 31 32 33 34 |
# File 'lib/axlsx/drawing/line_series.rb', line 29 def to_xml(xml) super(xml) do |xml| @labels.to_xml(xml) unless @labels.nil? @data.to_xml(xml) unless @data.nil? end end |