lib/axlsx/drawing/bubble_series.rb in caxlsx-3.4.1 vs lib/axlsx/drawing/bubble_series.rb in caxlsx-4.0.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Axlsx
# A BubbleSeries defines the x/y position and bubble size of data in the chart
# @note The recommended way to manage series is to use Chart#add_series
# @see Worksheet#add_chart
# @see Chart#add_series
@@ -24,31 +26,31 @@
# Creates a new BubbleSeries
def initialize(chart, options = {})
@xData, @yData, @bubbleSize = nil
super(chart, options)
- @xData = AxDataSource.new(:tag_name => :xVal, :data => options[:xData]) unless options[:xData].nil?
- @yData = NumDataSource.new({ :tag_name => :yVal, :data => options[:yData] }) unless options[:yData].nil?
- @bubbleSize = NumDataSource.new({ :tag_name => :bubbleSize, :data => options[:bubbleSize] }) unless options[:bubbleSize].nil?
+ @xData = AxDataSource.new(tag_name: :xVal, data: options[:xData]) unless options[:xData].nil?
+ @yData = NumDataSource.new({ tag_name: :yVal, data: options[:yData] }) unless options[:yData].nil?
+ @bubbleSize = NumDataSource.new({ tag_name: :bubbleSize, data: options[:bubbleSize] }) unless options[:bubbleSize].nil?
end
# @see color
def color=(v)
@color = v
end
# Serializes the object
# @param [String] str
# @return [String]
- def to_xml_string(str = '')
+ def to_xml_string(str = +'')
super(str) 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:srgbClr val="' << color << '"/>'
str << '</a:solidFill>'
str << '<a:ln><a:solidFill>'
- str << ('<a:srgbClr val="' << color << '"/></a:solidFill></a:ln>')
+ 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?