Class: GoogleChart::PieChart

Inherits:
Base
  • Object
show all
Defined in:
lib/google_chart/pie_chart.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL, Base::COMPLEX_ENCODING_ALPHABET, Base::SIMPLE_ENCODING

Instance Attribute Summary collapse

Attributes inherited from Base

#chart_size, #chart_title, #chart_type, #data_encoding, #params, #show_labels, #show_legend

Instance Method Summary collapse

Methods inherited from Base

#axis, #data, #fill, #grid, #to_url

Constructor Details

#initialize(chart_size = '300x200', chart_title = nil, is_3d = false) ⇒ PieChart

Initializes a Pie Chart object with a chart_size and chart_title. Specify is_3d as true to generate a 3D Pie chart



8
9
10
11
12
13
# File 'lib/google_chart/pie_chart.rb', line 8

def initialize(chart_size='300x200', chart_title=nil, is_3d = false)
    super(chart_size, chart_title)
    self.is_3d = is_3d
    self.show_labels = true
    self.show_legend = false
end

Instance Attribute Details

#is_3dObject

Returns the value of attribute is_3d.



5
6
7
# File 'lib/google_chart/pie_chart.rb', line 5

def is_3d
  @is_3d
end

Instance Method Details

#process_dataObject



24
25
26
# File 'lib/google_chart/pie_chart.rb', line 24

def process_data
    encode_data(@data)
end