module Axlsx class CatAxisData < SimpleTypedList def initialize(data=[]) super Object @list.concat data if data.is_a?(Array) end def to_xml(xml) xml.send('c:cat') { xml.send('c:strRef') { xml.send('c:f', Axlsx::cell_range(@list)) xml.send('c:strCache') { xml.send('c:ptCount', :val=>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