Sha256: 608490cabe04706209eb0250ebb2a5e0f9c447b6cebe33ab2732e5cccd4e2c7d

Contents?: true

Size: 1.29 KB

Versions: 12

Compression:

Stored size: 1.29 KB

Contents

# -----------------------------------------------------------------------------
# Sets up the 'exploding' factor on a particular chart. Only applies to pie,
# scattered and line charts.
#
# Applies to pie, line, and scatter charts only. In pie charts, it sets which pie wedge
# separates from the pie for emphasis. In line and scatter charts, it sets which line or
# point is increased in thickness or size for emphasis.
#
# <tt></tt>:
#
# See http://www.maani.us/xml_charts/index.php?menu=Reference&submenu=series_explode
# for additional documentation, examples and futher detail.
#
# Author:: Fernand Galiana
# Date::   Dec 15th, 2006
# -----------------------------------------------------------------------------
module Ziya::Components
  class SeriesExplode < Base    
    has_attribute :numbers
  
    # -------------------------------------------------------------------------
    # Dump has_attribute into xml element    
    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
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
derailed-ziya-2.0.4 lib/ziya/components/series_explode.rb
derailed-ziya-2.0.6 lib/ziya/components/series_explode.rb
derailed-ziya-2.0.8 lib/ziya/components/series_explode.rb
ziya-2.0.2 lib/ziya/components/series_explode.rb
ziya-2.0.0 lib/ziya/components/series_explode.rb
ziya-1.0.0 lib/ziya/components/series_explode.rb
ziya-2.0.1 lib/ziya/components/series_explode.rb
ziya-2.0.6 lib/ziya/components/series_explode.rb
ziya-2.0.7 lib/ziya/components/series_explode.rb
ziya-2.0.5 lib/ziya/components/series_explode.rb
ziya-2.0.4 lib/ziya/components/series_explode.rb
ziya-2.0.3 lib/ziya/components/series_explode.rb