Class: Ziya::Charts::Support::Text

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

Overview

Text component to draw text on the chart. Must be set up within the draw component. See www.maani.us/xml_charts/index.php?menu=Reference&submenu=draw for additional documentation, examples and futher detail.

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



19
20
21
22
23
# File 'lib/ziya/charts/support/text.rb', line 19

def flatten( xml )
  opts = options.clone
  text = opts.delete( :text )
  xml.text( opts ) { |x| x.text!( text.to_s ) }
end