Tag: lazy high charts

如何使用HighCharts在xAxis上列出日期(每天)

我正在尝试使用HighCharts在xAxis上显示日期(即按天)。 我正在使用带有Rails的Lazy High Charts gem来这样做。 对于HighCharts的“数据”参数,我传递的是[[date,revenue],[date,revenue],[date,revenue] …等]的嵌套数组。 带收入的yAxis工作正常,但xAxis中的相应日期不正常。 这是控制器代码: def graph_orders sales_and_date_array = [] Order.revenue_to_array(sales_and_date_array) puts sales_and_date_array.inspect # http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/series/data-array-of-arrays-datetime/ @chart = LazyHighCharts::HighChart.new(‘graph’) do |f| f.title(:text => “Lono Sales”) f.xAxis( type: ‘datetime’ ) f.series(:name => “Lono Sales Revenue”, :yAxis => 0, :data => sales_and_date_array) f.yAxis [ {:title => {:text => “Revenue”, :margin => 70} }, {:title […]

LazyHighchart和日期数据

高帮图有问题。 我有系列日期数据(借记,月),并想要绘制图表。 我可以图数据(仅借记卡),但是当我想添加日期时,有两个问题: x_axis数据显示错误(00:00:00.00)(00:00:00.00),预计月份(08/2012) 工具提示告诉我“无效日期” def index @ops = getConstantOps() @js_data = [] @ops.each { |f| tmp = [f.date_operation,f.debit] @js_data.push(tmp) } @h = LazyHighCharts::HighChart.new(‘graph’) do |f| f.options[:chart][:defaultSeriesType] = “area” f.x_axis({:type =>’datetime’} ) f.series( :name=>’Ops’, :data=>@js_data) end Ruby调试(@js_data)说 {— !ruby/object:LazyHighCharts::HighChart collection_filter: data: – :name: Ops :data: – – 2010-07-08 – 387.0 – – 2010-08-09 – 476.0 […]