Class: ObjectView::ChartData

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_paramsObject

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_paramsObject

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_secondsObject

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_urlObject

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_typeObject

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

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/object_view/chart_data.rb', line 6

def id
  @id
end

#labelObject

Returns the value of attribute label.



6
7
8
# File 'lib/object_view/chart_data.rb', line 6

def label
  @label
end

#seriesObject

Returns the value of attribute series.



6
7
8
# File 'lib/object_view/chart_data.rb', line 6

def series
  @series
end

#x_axis_labelObject

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_labelsObject

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