scroll bar with Lazy Highcharts

213 views Asked by At

Hi I am relatively new to rails and I am trying to implement a horizontal scrollbar using the lazy highcharts gem. So far I am having trouble getting the scrollbar to work, any suggestions on what I am doing wrong/leaving out?

Controller:

@logsChart = LazyHighCharts::HighChart.new('graph') do |f|
 f.series(:name=>'Session 2',:data=> [0, 20, 3, 5, 4, 10, 12 ])
 f.series(:name=>'Session 1',:data=>[1, 3, 4, 3, 3, 5,4,-46,2,3,2,1,5,6,7,3,2,4,3,5,7] ) 
 f.title({ :text=>"Load per Session"})
 f.xAxis( min: 0, 
         max:12,
         labels: {overflow: 'justify'})
 f.scrollbar(enabled: true)
 f.options[:chart][:defaultSeriesType] = "column"
 f.plot_options({:column=>{:stacking=>"percent"}})
end

View:

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

Gemfile:

gem 'lazy_high_charts', '1.5.0'
gem 'highstock-rails'

application.js:

//= require highcharts
//= require exporting
//= require highcharts/highcharts
//= require highcharts/highcharts-more
//= require highcharts/highstock
0

There are 0 answers