Class: MotionPlot::Series
- Inherits:
-
Object
- Object
- MotionPlot::Series
- Defined in:
- lib/motion-plot/series/series.rb
Constant Summary collapse
- COLORS =
['4572A7', 'AA4643', '89A54E', '80699B', '3D96AE', 'DB843D', '92A8CD', 'A47D7C', 'B5CA92']
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#index ⇒ Object
Returns the value of attribute index.
-
#name ⇒ Object
Returns the value of attribute name.
-
#plot_symbol ⇒ Object
readonly
Returns the value of attribute plot_symbol.
-
#style ⇒ Object
Returns the value of attribute style.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #color ⇒ Object
-
#initialize(args = {}) ⇒ Series
constructor
A new instance of Series.
- #width ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Series
Returns a new instance of Series.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/motion-plot/series/series.rb', line 9 def initialize(args={}) args.each_pair {|key, value| send("#{key}=", value) if(respond_to?("#{key}=")) } style_attr = args[:defaults].merge!(color: COLORS[args[:index]]) (style_attr, args[:plot_options]) merge_style(style_attr, args[:style]) @style = Style.new(style_attr) @plot_symbol = PlotSymbol.new(args[:plot_symbol].merge(index: @index)) if(args[:plot_symbol]) end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
6 7 8 |
# File 'lib/motion-plot/series/series.rb', line 6 def data @data end |
#index ⇒ Object
Returns the value of attribute index.
6 7 8 |
# File 'lib/motion-plot/series/series.rb', line 6 def index @index end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/motion-plot/series/series.rb', line 6 def name @name end |
#plot_symbol ⇒ Object (readonly)
Returns the value of attribute plot_symbol.
7 8 9 |
# File 'lib/motion-plot/series/series.rb', line 7 def plot_symbol @plot_symbol end |
#style ⇒ Object
Returns the value of attribute style.
6 7 8 |
# File 'lib/motion-plot/series/series.rb', line 6 def style @style end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/motion-plot/series/series.rb', line 6 def type @type end |
Instance Method Details
#color ⇒ Object
22 23 24 |
# File 'lib/motion-plot/series/series.rb', line 22 def color @style.color end |
#width ⇒ Object
26 27 28 |
# File 'lib/motion-plot/series/series.rb', line 26 def width @style.width end |