lead.js icon indicating copy to clipboard operation
lead.js copied to clipboard

make it easy to manupulate time series data

Open also opened this issue 12 years ago • 1 comments

also avatar Sep 17 '13 19:09 also

transform = (value) ->
  value * 167482

loading = tsd
  time_series: [metric_name: 'things', aggregation: 'max']
  start: moment.utc().subtract('hours', 2).unix()
  end: moment.utc().unix()

transformed = loading.then (series) ->
  _.each series, (s) -> _.each s.datapoints, (dp) -> dp[0] = transform dp[0]
  series

graph transformed

also avatar Sep 17 '13 19:09 also