Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/chartkick/core_ext.rb

Overview

for both multiple series and making sure hash order is preserved in JavaScript

Instance Method Summary collapse

Instance Method Details

#chart_jsonObject



5
6
7
8
9
10
11
12
13
# File 'lib/chartkick/core_ext.rb', line 5

def chart_json
  map do |v|
    if v.is_a?(Hash) && v[:data].is_a?(Hash)
      v = v.dup
      v[:data] = v[:data].to_a
    end
    v
  end.to_json
end