Class: Axlsx::SeriesTitle

Inherits:
Title
  • Object
show all
Defined in:
lib/axlsx/drawing/series_title.rb

Overview

A series title is a Title with a slightly different serialization than chart titles.

Instance Attribute Summary

Attributes inherited from Title

cell, text

Instance Method Summary (collapse)

Methods inherited from Title

#initialize, #range

Constructor Details

This class inherits a constructor from Axlsx::Title

Instance Method Details

- (String) to_xml(xml)

Serializes the series title

Parameters:

  • xml (Nokogiri::XML::Builder)

    The document builder instance this objects xml will be added to.

Returns:

  • (String)


8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/axlsx/drawing/series_title.rb', line 8

def to_xml(xml)
  xml.send('c:tx') {
    xml.send('c:strRef') {
      xml.send('c:f', range)
      xml.send('c:strCache') {
        xml.send('c:ptCount', :val=>1)
        xml.send('c:pt', :idx=>0) {
          xml.send('c:v', @text)
        }
      }
    }
  }
end