score:3

Accepted answer

could you try to use lazy-high-chart gem? it's easy and it will save your time when doing this.

https://github.com/michelson/lazy_high_charts

e.g. in controller,

@h = lazyhighcharts::highchart.new('graph') do |f|
f.options[:chart][:defaultseriestype] = "area"
f.series(:name=>'john', :data=>[3, 20, 3, 5, 4, 10, 12 ,3, 5,6,7,7,80,9,9])
f.series(:name=>'jane', :data=> [1, 3, 4, 3, 3, 5, 4,-46,7,8,8,9,9,0,0,9] )
end

in view,

<%= high_chart("my_id", @h) %>

Related Query

More Query from same tag