Class: Plotly::Data

Inherits:
Object show all
Includes:
Castable
Defined in:
lib/plotly/data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Castable

#to_h

Constructor Details

#initialize(opts = {}) ⇒ Data

Returns a new instance of Data.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • x (Array)
  • y (Array)
  • values (Array)
  • labels (Array)
  • mode (String)
  • type (String)
  • name (String)


16
17
18
# File 'lib/plotly/data.rb', line 16

def initialize(opts = {})
  opts.each { |k, v| instance_variable_set("@#{k}", v) }
end

Instance Attribute Details

#labelsObject

Returns the value of attribute labels.



7
8
9
# File 'lib/plotly/data.rb', line 7

def labels
  @labels
end

#modeObject

Returns the value of attribute mode.



7
8
9
# File 'lib/plotly/data.rb', line 7

def mode
  @mode
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/plotly/data.rb', line 7

def name
  @name
end

#typeObject

Returns the value of attribute type.



7
8
9
# File 'lib/plotly/data.rb', line 7

def type
  @type
end

#valuesObject

Returns the value of attribute values.



7
8
9
# File 'lib/plotly/data.rb', line 7

def values
  @values
end

#xObject

Returns the value of attribute x.



7
8
9
# File 'lib/plotly/data.rb', line 7

def x
  @x
end

#yObject

Returns the value of attribute y.



7
8
9
# File 'lib/plotly/data.rb', line 7

def y
  @y
end