score:0

Accepted answer

i had problems fetching updated data from my controllers to populate my highcharts data. instead of using gon, which kept returning stale data, i switched to json. works like a charm now.

score:1

use lazy-high-chart to save your time!

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