lib/axlsx/drawing/series_title.rb in axlsx-1.0.18 vs lib/axlsx/drawing/series_title.rb in axlsx-1.1.0
- old
+ new
@@ -1,23 +1,23 @@
# encoding: UTF-8
module Axlsx
# A series title is a Title with a slightly different serialization than chart titles.
class SeriesTitle < Title
- # Serializes the series title
- # @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to.
+ # Serializes the object
+ # @param [String] str
# @return [String]
- def to_xml(xml)
- xml[:c].tx {
- xml[:c].strRef {
- xml[:c].f Axlsx::cell_range([@cell])
- xml[:c].strCache {
- xml[:c].ptCount :val=>1
- xml[:c].pt(:idx=>0) {
- xml[:c].v @text
- }
- }
- }
- }
+ def to_xml_string(str = '')
+ str << '<c:tx>'
+ str << '<c:strRef>'
+ str << '<c:f>' << Axlsx::cell_range([@cell]) << '</c:f>'
+ str << '<c:strCache>'
+ str << '<c:ptCount val="1"/>'
+ str << '<c:pt idx="0">'
+ str << '<c:v>' << @text << '</c:v>'
+ str << '</c:pt>'
+ str << '</c:strCache>'
+ str << '</c:strRef>'
+ str << '</c:tx>'
end
end
end