I am trying to use https://github.com/michelson/lazy_high_charts to render a simple area chart with dates on the x-axis and scores on the y-axis. I used the following snippet from lazy_high_charts. Graph is rendered but x-axis is not dates.
@h = LazyHighCharts::HighChart.new('graph', style: '') do |f|
f.options[:chart][:defaultSeriesType] = "area"
f.options[:plotOptions] = {areaspline: {pointInterval: 1.day, pointStart: 10.days.ago}}
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])
f.xAxis(type: :datetime)
end
I would like to have time series with a day interval, something like this http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/series-pointstart-datetime/.
Above code produces the following html (http://jsfiddle.net/nUxvA/)
I tried to compare both and the plot options is different. How can I have day interval scale on x-axis?