Sha256: 59ca435c7cea6a72fd4c4d6022e0d46877403fcee318cc48c546c916997441ad

Contents?: true

Size: 706 Bytes

Versions: 1

Compression:

Stored size: 706 Bytes

Contents

module Axlsx

  class ValAxisData < SimpleTypedList
    def initialize(data=[])
      super Object
      @list.concat data if data.is_a?(Array)
    end

    def to_xml(xml)
      xml.send('c:val') {
        xml.send('c:numRef') {
          xml.send('c:f', Axlsx::cell_range(@list))
          xml.send('c:numCache') {
            xml.send('c:formatCode', 'General')
            xml.send('c:ptCount', :val=>data.size)
            each_with_index do |item, index|
              v = item.is_a?(Cell) ? item.value : item
              xml.send('c:pt', :idx=>index) {
                xml.send('c:v', v) 
              }
            end
          }                        
        }
      }
    end

  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axlsx-1.0.7 lib/axlsx/drawing/val_axis_data.rb~