带有Lazy Highcharts的滚动条

时间:2016-07-30 12:30:55

标签: ruby-on-rails highcharts scrollbar highstock lazy-high-charts

您好我对rails很新,我正在尝试使用lazy highcharts gem实现水平滚动条。到目前为止,我无法让滚动条工作,有什么建议我做错了什么/遗漏了吗?

控制器:

@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

查看:

<%= 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 个答案:

没有答案