代码之家  ›  专栏  ›  技术社区  ›  cbrulak

船队:日期范围的具体最小值/最大值

  •  1
  • cbrulak  · 技术社区  · 14 年前

    我有一个基本的PageView模型,可以跟踪特定页面的打开时间。

    我想显示一个点击率随时间变化的图表。我用flotilla来生成图形。

    现在,如果我有一个时间段的一系列页面视图,但我想显示一个时间段,即使没有页面视图,flotilla似乎呈现一个图形,只封装了第一个和最后一个页面视图的时间(不是我想要的最小/最大值)。

    这是我的密码:

    chart("graph", { "Store 1" => { :collection => @store_one, :x => :date, :y => :sales }},:xaxis => {:mode=>"time", :min => @store_one.created_at,:max => Date.current})
    

    我也试过了 :mode=>"date" :mode=>"datetime"

    有什么想法吗?

    2 回复  |  直到 14 年前
        1
  •  0
  •   johno    14 年前

    看着 flotila source 我敢打赌 :xaxis

    :xaxis => {:mode=>"time", :min => @store_one.created_at.to_time.to_i * 1000,:max => Date.current.to_time.to_i * 1000}

    免责声明:从未使用过flotila或flot。

        2
  •  -1
  •   RobinGower    14 年前

    :max => Date.current+1