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