Class: Charty::Plotters::AbstractPlotter

Inherits:
Object
  • Object
show all
Defined in:
lib/charty/plotters/abstract_plotter.rb

Direct Known Subclasses

CategoricalPlotter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, color, **options) {|_self| ... } ⇒ AbstractPlotter

Returns a new instance of AbstractPlotter.

Yields:

  • (_self)

Yield Parameters:



4
5
6
7
8
9
10
11
12
# File 'lib/charty/plotters/abstract_plotter.rb', line 4

def initialize(x, y, color, **options)
  self.x = x
  self.y = y
  self.color = color
  self.data = data
  self.palette = palette
  substitute_options(options)
  yield self if block_given?
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



14
15
16
# File 'lib/charty/plotters/abstract_plotter.rb', line 14

def color
  @color
end

#dataObject

Returns the value of attribute data.



14
15
16
# File 'lib/charty/plotters/abstract_plotter.rb', line 14

def data
  @data
end

#paletteObject

Returns the value of attribute palette.



14
15
16
# File 'lib/charty/plotters/abstract_plotter.rb', line 14

def palette
  @palette
end

#xObject

Returns the value of attribute x.



14
15
16
# File 'lib/charty/plotters/abstract_plotter.rb', line 14

def x
  @x
end

#yObject

Returns the value of attribute y.



14
15
16
# File 'lib/charty/plotters/abstract_plotter.rb', line 14

def y
  @y
end

Instance Method Details

#to_irubyObject



75
76
77
78
# File 'lib/charty/plotters/abstract_plotter.rb', line 75

def to_iruby
  result = render
  ["text/html", result] if result
end