Class: Axlsx::ScatterSeries
- Defined in:
- lib/axlsx/drawing/scatter_series.rb
Overview
Note:
The recommended way to manage series is to use Chart#add_series
A ScatterSeries defines the x and y position of data in the chart
Instance Attribute Summary collapse
-
#xData ⇒ NamedAxisData
readonly
The x data for this series.
-
#yData ⇒ NamedAxisData
readonly
The y data for this series.
Attributes inherited from Series
Instance Method Summary collapse
-
#initialize(chart, options = {}) ⇒ ScatterSeries
constructor
Creates a new ScatterSeries.
-
#to_xml_string(str = '') ⇒ String
Serializes the object.
Methods inherited from Series
Constructor Details
#initialize(chart, options = {}) ⇒ ScatterSeries
Creates a new ScatterSeries
20 21 22 23 24 25 26 |
# File 'lib/axlsx/drawing/scatter_series.rb', line 20 def initialize(chart, ={}) @xData, @yData = nil super(chart, ) @xData = NamedAxisData.new("xVal", [:xData]) unless [:xData].nil? @yData = NamedAxisData.new("yVal", [:yData]) unless [:yData].nil? end |
Instance Attribute Details
#xData ⇒ NamedAxisData (readonly)
The x data for this series.
13 14 15 |
# File 'lib/axlsx/drawing/scatter_series.rb', line 13 def xData @xData end |
#yData ⇒ NamedAxisData (readonly)
The y data for this series.
17 18 19 |
# File 'lib/axlsx/drawing/scatter_series.rb', line 17 def yData @yData end |
Instance Method Details
#to_xml_string(str = '') ⇒ String
Serializes the object
31 32 33 34 35 36 37 |
# File 'lib/axlsx/drawing/scatter_series.rb', line 31 def to_xml_string(str = '') super(str) do |inner_str| @xData.to_xml_string(inner_str) unless @xData.nil? @yData.to_xml_string(inner_str) unless @yData.nil? end str end |