Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

hack to keep the width of vertical labels the same

  • Loading branch information...
commit b84e389a7fffac13e3a8d7daddf459fece1b9bac 1 parent fd5c51e
@phunehehe authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 agraph.coffee
View
12 agraph.coffee
@@ -4,6 +4,10 @@ Date::format = (formatString) ->
return formatString.replace('%H', hours).replace('%M', minutes)
+String::repeat = (times) ->
+ return new Array(times + 1).join(this)
+
+
class Snapshot
constructor: (@tuple) ->
timestamp: ->
@@ -71,6 +75,13 @@ drawFlotr = (container, series, options) ->
tickFormatter: (millis) ->
date = new Date(parseInt(millis))
return date.format('%H:%M')
+ },
+ yaxis: {
+ tickFormatter: (valStr) ->
+ val = parseFloat(valStr)
+ if val == 0
+ return ' '.repeat(10) + '0'
+ return valStr
}
}
defaultOptions = Flotr._.extend(defaultOptions, options)
@@ -108,7 +119,6 @@ makeContainer = (id, extraClass, newRow=true) ->
$(document).ready ->
-
drawFlotr(
makeContainer('dsk', 'span12'),
ioTimeSeries(data),
Please sign in to comment.
Something went wrong with that request. Please try again.