Class: Ziya::Charts::Support::Link
- Defined in:
- lib/ziya/charts/support/link.rb
Overview
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.
:
See www.maani.us/xml_charts/index.php?menu=Reference&submenu=link for additional documentation, examples and futher detail.
Instance Method Summary collapse
-
#flatten(xml) ⇒ Object
————————————————————————- Dump has_attribute into xml element.
-
#merge(parent_attributes, override = false) ⇒ Object
————————————————————————- Override merge attributes enhance component definitions vs override.
Methods inherited from Base
#==, attributes, #attributes_for, #configured?, has_attribute, #has_sub_components, #initialize, #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
29 30 31 32 33 34 35 |
# File 'lib/ziya/charts/support/link.rb', line 29 def flatten( xml ) if areas xml.link do areas.each { |area| area.flatten( xml ) } end end end |
#merge(parent_attributes, override = false) ⇒ Object
Override merge attributes enhance component definitions vs override
21 22 23 24 25 |
# File 'lib/ziya/charts/support/link.rb', line 21 def merge( parent_attributes, override=false ) comps = send( :areas ) || [] comps = comps + parent_attributes.send( :areas ) if parent_attributes.send( :areas ) send( "areas=", comps ) end |