Class: GChart::Pie
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
#axes, #chart_background, #colors, #data, #entire_background, #extras, #height, #legend, #max, #title, #width
Instance Method Summary collapse
-
#data=(data) ⇒ Object
A single array of chart data.
-
#render_chart_type ⇒ Object
:nodoc:.
-
#render_legend(params) ⇒ Object
:nodoc:.
Methods inherited from Base
#axis, #fetch, #initialize, #size, #size=, #to_url, #write
Constructor Details
This class inherits a constructor from GChart::Base
Instance Method Details
#data=(data) ⇒ Object
A single array of chart data. Raises ArgumentError
if more than one data set is provided.
5 6 7 8 9 10 11 |
# File 'lib/gchart/pie.rb', line 5 def data=(data) if data.is_a?(Array) and data.first.is_a?(Array) and data.size > 1 raise ArgumentError, "Pie charts only have one data set" end super(data) end |
#render_chart_type ⇒ Object
:nodoc:
13 14 15 |
# File 'lib/gchart/pie.rb', line 13 def render_chart_type #:nodoc: "p" end |
#render_legend(params) ⇒ Object
:nodoc:
17 18 19 |
# File 'lib/gchart/pie.rb', line 17 def render_legend(params) #:nodoc: params["chl"] = legend.join("|") if legend end |