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

Constructor Details

This class inherits a constructor from Axlsx::Title

Instance Method Details

#to_xml(xml) ⇒ String

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[: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
        }
      }
    }
  }
end