Class: ObjectView::ChartData
- Inherits:
-
Object
- Object
- ObjectView::ChartData
- Defined in:
- lib/object_view/chart_data.rb
Overview
ajax_method_for_params specifies a javascript method that will be called by ajax update script to retrieve non-static params This method needs to be added to page and returns a string in the form : “a=b&c=d&e=f”
Constant Summary collapse
- @@chart_id =
0
Instance Attribute Summary collapse
-
#ajax_method_for_params ⇒ Object
Returns the value of attribute ajax_method_for_params.
-
#ajax_params ⇒ Object
Returns the value of attribute ajax_params.
-
#ajax_refresh_seconds ⇒ Object
Returns the value of attribute ajax_refresh_seconds.
-
#ajax_url ⇒ Object
Returns the value of attribute ajax_url.
-
#chart_type ⇒ Object
Returns the value of attribute chart_type.
-
#id ⇒ Object
Returns the value of attribute id.
-
#label ⇒ Object
Returns the value of attribute label.
-
#series ⇒ Object
Returns the value of attribute series.
-
#x_axis_label ⇒ Object
Returns the value of attribute x_axis_label.
-
#y_axis_labels ⇒ Object
Returns the value of attribute y_axis_labels.
Instance Method Summary collapse
-
#initialize(type) ⇒ ChartData
constructor
A new instance of ChartData.
Constructor Details
#initialize(type) ⇒ ChartData
Returns a new instance of ChartData.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/object_view/chart_data.rb', line 8 def initialize(type) @@chart_id += 1 @ajax_method_for_params = nil @ajax_refresh_seconds = 20 @ajax_params = Hash.new @id = "chart_#{@@chart_id}" @chart_type = type @series = [] @x_axis_label = "Time" @y_axis_labels = ["Count"] end |
Instance Attribute Details
#ajax_method_for_params ⇒ Object
Returns the value of attribute ajax_method_for_params.
6 7 8 |
# File 'lib/object_view/chart_data.rb', line 6 def ajax_method_for_params @ajax_method_for_params end |
#ajax_params ⇒ Object
Returns the value of attribute ajax_params.
6 7 8 |
# File 'lib/object_view/chart_data.rb', line 6 def ajax_params @ajax_params end |
#ajax_refresh_seconds ⇒ Object
Returns the value of attribute ajax_refresh_seconds.
6 7 8 |
# File 'lib/object_view/chart_data.rb', line 6 def ajax_refresh_seconds @ajax_refresh_seconds end |
#ajax_url ⇒ Object
Returns the value of attribute ajax_url.
6 7 8 |
# File 'lib/object_view/chart_data.rb', line 6 def ajax_url @ajax_url end |
#chart_type ⇒ Object
Returns the value of attribute chart_type.
6 7 8 |
# File 'lib/object_view/chart_data.rb', line 6 def chart_type @chart_type end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/object_view/chart_data.rb', line 6 def id @id end |
#label ⇒ Object
Returns the value of attribute label.
6 7 8 |
# File 'lib/object_view/chart_data.rb', line 6 def label @label end |
#series ⇒ Object
Returns the value of attribute series.
6 7 8 |
# File 'lib/object_view/chart_data.rb', line 6 def series @series end |
#x_axis_label ⇒ Object
Returns the value of attribute x_axis_label.
6 7 8 |
# File 'lib/object_view/chart_data.rb', line 6 def x_axis_label @x_axis_label end |
#y_axis_labels ⇒ Object
Returns the value of attribute y_axis_labels.
6 7 8 |
# File 'lib/object_view/chart_data.rb', line 6 def y_axis_labels @y_axis_labels end |