Class: Axlsx::ValAxisData
- Inherits:
-
CatAxisData
- Object
- SimpleTypedList
- CatAxisData
- Axlsx::ValAxisData
- Defined in:
- lib/axlsx/drawing/val_axis_data.rb
Overview
The ValAxisData class manages the values for a chart value series.
Instance Method Summary collapse
-
#to_xml_string(str = '') ⇒ String
Serializes the object.
Methods inherited from CatAxisData
Constructor Details
This class inherits a constructor from Axlsx::CatAxisData
Instance Method Details
#to_xml_string(str = '') ⇒ String
Serializes the object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/axlsx/drawing/val_axis_data.rb', line 9 def to_xml_string(str = '') str << '<c:val>' str << '<c:numRef>' str << '<c:f>' << Axlsx::cell_range(@list) << '</c:f>' str << '<c:numCache>' str << '<c:formatCode>General</c:formatCode>' str << '<c:ptCount val="' << size.to_s << '"/>' each_with_index do |item, index| v = item.is_a?(Cell) ? item.value.to_s : item str << '<c:pt idx="' << index.to_s << '"><c:v>' << v << '</c:v></c:pt>' end str << '</c:numCache>' str << '</c:numRef>' str << '</c:val>' end |