Sha256: 644d51365a5bc2f28a28ac9b15508e63afacee3def2269dadf3cfe175392e29b

Contents?: true

Size: 1.35 KB

Versions: 6

Compression:

Stored size: 1.35 KB

Contents

# -----------------------------------------------------------------------------
# Sets up clickable areas on the chart.
#
# Author:: Fernand Galiana
# -----------------------------------------------------------------------------
module Ziya::Charts::Support
  # Sets up clickable areas on the chart.
  #
  # Holds any number of areas, each defining a rectangle and a URL to go to when the user
  # clicks inside the rectangle. This can also be used to make refresh or print buttons.
  #
  # <tt></tt>:
  #
  # See http://www.maani.us/xml_charts/index.php?menu=Reference&submenu=link
  # for additional documentation, examples and futher detail.  
  class Link < Base  
    has_attribute :areas
                     
    # -------------------------------------------------------------------------
    # Override merge attributes enhance component definitions vs override
    def merge( parent_attributes, override=false )
      comps = send( :areas ) || []
      comps = comps + parent_attributes.send( :areas ) if parent_attributes.send( :areas )
      send( "areas=", comps )
    end
                     
    # -------------------------------------------------------------------------
    # Dump has_attribute into xml element
    def flatten( xml )
      if areas
        xml.link do
          areas.each { |area| area.flatten( xml ) }
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
derailed-ziya-2.1.5 lib/ziya/charts/support/link.rb
ziya-2.3.0 lib/ziya/charts/support/link.rb
ziya-2.1.9 lib/ziya/charts/support/link.rb
ziya-2.1.8 lib/ziya/charts/support/link.rb
ziya-2.1.7 lib/ziya/charts/support/link.rb
ziya-2.1.6 lib/ziya/charts/support/link.rb