Commit b2350763 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

timeline_widget: ticks option

parent 17558770
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -484,6 +484,7 @@ FnordMetric.namespace :ulikeme do
  widget "Competition", {
    :title => "Competition: Badoo",
    :type => :timeline,
    :ticks => 90,
    :gauges => [:competitors_badoo_mau, :competitors_badoo_dau]
  }

@@ -497,6 +498,7 @@ FnordMetric.namespace :ulikeme do
  widget "Competition", {
    :title => "Competition: zoosk",
    :type => :timeline,
    :ticks => 90,
    :gauges => [:competitors_zoosk_mau, :competitors_zoosk_dau]
  }

@@ -510,6 +512,7 @@ FnordMetric.namespace :ulikeme do
  widget "Competition", {
    :title => "Competition: onetwolike",
    :type => :timeline,
    :ticks => 90,
    :gauges => [:competitors_onetwolike_mau, :competitors_onetwolike_dau]
  }

@@ -523,6 +526,7 @@ FnordMetric.namespace :ulikeme do
  widget "Competition", {
    :title => "Competition: kizzle",
    :type => :timeline,
    :ticks => 90,
    :gauges => [:competitors_kizzle_mau, :competitors_kizzle_dau]
  }

@@ -536,6 +540,7 @@ FnordMetric.namespace :ulikeme do
  widget "Competition", {
    :title => "Competition: areyouinterested",
    :type => :timeline,
    :ticks => 90,
    :gauges => [:competitors_areyouinterested_mau, :competitors_areyouinterested_dau]
  }

+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ class FnordMetric::Widget
    ensure_has_tick!
    te = gauges.first.tick_at(now.to_i)
    te -= @tick unless include_current?
    rs = @tick == 1.hour.to_i ? 24 : 30
    rs = (@opts[:ticks] || (@tick == 1.hour.to_i ? 24 : 30)).to_i
    (te-(@tick*rs)..te)
  end

+1 −0
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ call these methods from the event-handler block

[plot_style] one of: line, areaspline
[include_current] show the current tick?
[ticks] number of ticks to show (defaults to 24/30)

==== Widget-Options: BarsWidget