Class: OpenFlashChart::PieValue

Inherits:
Base
  • Object
show all
Defined in:
lib/open_flash_chart/pie.rb

Instance Method Summary (collapse)

Methods inherited from Base

#<<, #add_element, #append_value, #attach_to_right_y_axis, #method_missing, #render, #set_colours, #set_key, #set_offset, #set_range, #set_tooltip, #to_json2

Constructor Details

- (PieValue) initialize(value, label, args = {})

Returns a new instance of PieValue



4
5
6
7
8
9
# File 'lib/open_flash_chart/pie.rb', line 4

def initialize(value, label, args={})
  super args
  @value = value
  @label = label      
  @animate = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class OpenFlashChart::Base

Instance Method Details

- (Object) add_animation(animation)



21
22
23
24
25
# File 'lib/open_flash_chart/pie.rb', line 21

def add_animation animation
  @animate ||= []
  @animate << animation
  return self
end

- (Object) on_click(event)



17
18
19
# File 'lib/open_flash_chart/pie.rb', line 17

def on_click(event)
  @on_click = event
end

- (Object) set_label(label, label_color, font_size)



11
12
13
14
15
# File 'lib/open_flash_chart/pie.rb', line 11

def set_label(label, label_color, font_size)
  self.label        = label
  self.label_colour = label_color
  self.font_size    = font_size
end