Class: Analytica::DataSet

Inherits:
Array
  • Object
show all
Includes:
Computation, Visualization::DataSet, Visualization::Representation
Defined in:
lib/analytica.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Visualization::DataSet

#datamax, #to_bargraph, #to_linegraph, #to_sparkline

Methods included from Visualization::Representation

#add_custom, #bar_settings, #common_options, #generate_custom, #generate_labels, #generate_title, #set_labels, #set_title

Methods included from Computation

#average_filter, #exponential_mean, #exponential_moving_average, #linear_mean, #linear_moving_average, #mean, #moving_average, #piecewise_derivative, #savitzky_golay, #simple_moving_average, #sum

Constructor Details

#initialize(datapoints = []) ⇒ DataSet

Returns a new instance of DataSet.



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/analytica.rb', line 32

def initialize(datapoints=[])
  enforce!(:numeric_array, datapoints)
  
  @custom = ""
  @custom_set = false

  @labels = {}
  @labels_set = false

  super datapoints
end

Instance Attribute Details

#labelsObject

Returns the value of attribute labels.



30
31
32
# File 'lib/analytica.rb', line 30

def labels
  @labels
end

Instance Method Details

#+(other) ⇒ Object



54
55
56
57
# File 'lib/analytica.rb', line 54

def +(other)
  enforce!(:numeric_array, other)
  super other
end

#<<(object) ⇒ Object



44
45
46
47
# File 'lib/analytica.rb', line 44

def <<(object)
  enforce!(:numeric, object)
  super object
end

#concat(other) ⇒ Object



49
50
51
52
# File 'lib/analytica.rb', line 49

def concat(other)
  enforce!(:numeric_array, other)
  super other
end