Class: Axlsx::BubbleSeries
- Defined in:
- lib/axlsx/drawing/bubble_series.rb
Overview
Note:
The recommended way to manage series is to use Chart#add_series
A BubbleSeries defines the x/y position and bubble size of data in the chart
Instance Attribute Summary collapse
-
#bubbleSize ⇒ NumDataSource
readonly
The bubble size for this series.
-
#color ⇒ String
The fill color for this series.
-
#xData ⇒ AxDataSource
readonly
The x data for this series.
-
#yData ⇒ NumDataSource
readonly
The y data for this series.
Attributes inherited from Series
Instance Method Summary collapse
-
#initialize(chart, options = {}) ⇒ BubbleSeries
constructor
Creates a new BubbleSeries.
-
#to_xml_string(str = +'')) ⇒ String
Serializes the object.
Methods inherited from Series
Methods included from OptionsParser
Constructor Details
#initialize(chart, options = {}) ⇒ BubbleSeries
Creates a new BubbleSeries
28 29 30 31 32 33 34 |
# File 'lib/axlsx/drawing/bubble_series.rb', line 28 def initialize(chart, = {}) @xData, @yData, @bubbleSize = nil super @xData = AxDataSource.new(tag_name: :xVal, data: [:xData]) unless [:xData].nil? @yData = NumDataSource.new({ tag_name: :yVal, data: [:yData] }) unless [:yData].nil? @bubbleSize = NumDataSource.new({ tag_name: :bubbleSize, data: [:bubbleSize] }) unless [:bubbleSize].nil? end |
Instance Attribute Details
#bubbleSize ⇒ NumDataSource (readonly)
The bubble size for this series.
20 21 22 |
# File 'lib/axlsx/drawing/bubble_series.rb', line 20 def bubbleSize @bubbleSize end |
#color ⇒ String
The fill color for this series. Red, green, and blue is expressed as sequence of hex digits, RRGGBB. A perceptual gamma of 2.2 is used.
25 26 27 |
# File 'lib/axlsx/drawing/bubble_series.rb', line 25 def color @color end |
#xData ⇒ AxDataSource (readonly)
The x data for this series.
12 13 14 |
# File 'lib/axlsx/drawing/bubble_series.rb', line 12 def xData @xData end |
#yData ⇒ NumDataSource (readonly)
The y data for this series.
16 17 18 |
# File 'lib/axlsx/drawing/bubble_series.rb', line 16 def yData @yData end |
Instance Method Details
#to_xml_string(str = +'')) ⇒ String
Serializes the object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/axlsx/drawing/bubble_series.rb', line 44 def to_xml_string(str = +'') super do # needs to override the super color here to push in ln/and something else! if color str << '<c:spPr><a:solidFill>' str << '<a:srgbClr val="' << color << '"/>' str << '</a:solidFill>' str << '<a:ln><a:solidFill>' str << '<a:srgbClr val="' << color << '"/></a:solidFill></a:ln>' str << '</c:spPr>' end @xData.to_xml_string(str) unless @xData.nil? @yData.to_xml_string(str) unless @yData.nil? @bubbleSize.to_xml_string(str) unless @bubbleSize.nil? end str end |