Class: Highcharts::Series
Instance Attribute Summary
Attributes inherited from Base
#default, #options, #skip_quotation, #suboptions
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Highcharts::Base
Instance Method Details
#to_json ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/highcharts/series.rb', line 4 def to_json [:data] = if [:data].first.is_a?(Array) || [:data].first.is_a?(Hash) [:data].collect do |d| if d.is_a?(Array) [d.first, d.last.to_f] else d[:y] = d[:y].to_f d end end else [:data].collect(&:to_f) end super end |