Class: GoogleCharts::Charts::Base
- Inherits:
-
Object
- Object
- GoogleCharts::Charts::Base
- Defined in:
- lib/google_charts/charts/base.rb
Instance Method Summary collapse
-
#initialize(template, collection, options = {}, html_options = {}) ⇒ Base
constructor
A new instance of Base.
- #title(val) ⇒ Object
- #to_html ⇒ Object
Constructor Details
#initialize(template, collection, options = {}, html_options = {}) ⇒ Base
Returns a new instance of Base.
5 6 7 8 9 10 11 12 13 |
# File 'lib/google_charts/charts/base.rb', line 5 def initialize( template, collection, = {}, = {} ) @template = template @collection = collection @options = @html_options = { :id => "googleChart" }.merge( ) @columns, @rows = [], [] end |
Instance Method Details
#title(val) ⇒ Object
15 |
# File 'lib/google_charts/charts/base.rb', line 15 def title( val ); @options[:title] = val; end |
#to_html ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/google_charts/charts/base.rb', line 17 def to_html setup_data [ google_jsapi, container_div, google_chart ].join("\n") end |