Method: Flotr::Data#initialize
- Defined in:
- lib/flotr.rb
#initialize(opts = {}) ⇒ Data
Creates a new serie of points. opts is a Hash with a subset of the keys
given in OPTIONS.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/flotr.rb', line 38 def initialize(opts={}) @data = [] opts.each do |k,v| if OPTIONS.include? k self.send(k.to_s+'=', v) else warn "Warning: data option '#{k}' does not exist, ignored" end end end |