# encoding: UTF-8 module Axlsx # The CatAxisData class serializes the category axis data for a chart class CatAxisData < SimpleTypedList # Create a new CatAxisData object # @param [Array, SimpleTypedList] data the data for this category axis. This can be a simple array or a simple typed list of cells. def initialize(data=[]) super Object @list.concat data if data.is_a?(Array) data.each { |i| @list << i } if data.is_a?(SimpleTypedList) end def to_xml_string(str = '') str << '' str << '' str << '' << Axlsx::cell_range(@list) << '' str << '' str << '' each_with_index do |item, index| v = item.is_a?(Cell) ? item.value.to_s : item str << '' << v << '' end str << '' str << '' str << '' end end end