Class: Ziya::Charts::Support::SeriesExplode

Inherits:
Base
  • Object
show all
Defined in:
lib/ziya/charts/support/series_explode.rb

Instance Method Summary collapse

Methods inherited from Base

#==, attributes, #attributes_for, #configured?, has_attribute, #has_sub_components, #initialize, #merge, #options, #options_as_string

Constructor Details

This class inherits a constructor from Ziya::Charts::Support::Base

Instance Method Details

#flatten(xml) ⇒ Object


Dump has_attribute into xml element



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/ziya/charts/support/series_explode.rb', line 23

def flatten( xml )
  if numbers
    xml.series_explode do
      if numbers.is_a? String
        nums = numbers.split( "," )
        nums.each { |n| xml.number( n.strip ) }
      elsif numbers.respond_to? :each
        numbers.each { |n| xml.number( n ) }
      else
        xml.number( numbers )
      end
    end   
  end
end