Class: GoogleChart::PieChart
- Defined in:
- lib/dynamic_reports/vendor/google_chart/pie_chart.rb
Constant Summary
Constants inherited from Base
Base::BASE_URL, Base::COMPLEX_ENCODING_ALPHABET, Base::DEFAULT_LINE_STYLE, Base::SHAPE_MARKERS, Base::SIMPLE_ENCODING
Instance Attribute Summary collapse
-
#is_3d ⇒ Object
set to
true
orfalse
to indicate if this is a 3d chart. -
#show_labels ⇒ Object
set to
true
orfalse
to show or hide pie chart labels.
Attributes inherited from Base
#chart_size, #chart_title, #chart_type, #data_encoding, #params, #show_legend, #title_color, #title_font_size
Instance Method Summary collapse
-
#initialize(chart_size = '300x200', chart_title = nil, is_3d = false) {|_self| ... } ⇒ PieChart
constructor
Initializes a Pie Chart object with a
chart_size
andchart_title
. - #process_data ⇒ Object
Methods inherited from Base
#axis, #data, #fill, #fill_area, #grid, #max_value, #range_marker, #shape_marker, #to_escaped_url, #to_url
Constructor Details
#initialize(chart_size = '300x200', chart_title = nil, is_3d = false) {|_self| ... } ⇒ PieChart
Initializes a Pie Chart object with a chart_size
and chart_title
. Specify is_3d
as true
to generate a 3D Pie chart
12 13 14 15 16 17 18 |
# File 'lib/dynamic_reports/vendor/google_chart/pie_chart.rb', line 12 def initialize(chart_size='300x200', chart_title=nil, is_3d = false) # :yield: self super(chart_size, chart_title) self.is_3d = is_3d self.show_legend = false self.show_labels = true yield self if block_given? end |
Instance Attribute Details
#is_3d ⇒ Object
set to true
or false
to indicate if this is a 3d chart
6 7 8 |
# File 'lib/dynamic_reports/vendor/google_chart/pie_chart.rb', line 6 def is_3d @is_3d end |
#show_labels ⇒ Object
set to true
or false
to show or hide pie chart labels
9 10 11 |
# File 'lib/dynamic_reports/vendor/google_chart/pie_chart.rb', line 9 def show_labels @show_labels end |
Instance Method Details
#process_data ⇒ Object
29 30 31 |
# File 'lib/dynamic_reports/vendor/google_chart/pie_chart.rb', line 29 def process_data encode_data(@data, max_data_value) end |