Skip to content
Snippets Groups Projects
Commit dafb6e84 authored by Mathis Neumann's avatar Mathis Neumann
Browse files

use correct timestamp format for time series plotting

parent e1527987
No related branches found
No related tags found
No related merge requests found
...@@ -48,10 +48,9 @@ export default Component.extend({ ...@@ -48,10 +48,9 @@ export default Component.extend({
} }
const $this = this.$(); const $this = this.$();
// flot data points are tuples/arrays [x,y], graphs are arrays of these // flot data points are tuples/arrays [x,y], graphs are arrays of these
// converts unix timestamps to javascript timestamps (*1000)
// use Ember.get because it would work with Ember.Object and plain JS // use Ember.get because it would work with Ember.Object and plain JS
const plotData = this.get('timeSeries.series') const plotData = this.get('timeSeries.series')
.map((valueObj) => [get(valueObj, 'timestamp')*1000, get(valueObj, 'value')]); .map((valueObj) => [get(valueObj, 'timestamp'), get(valueObj, 'value')]);
this.debug('plotData', plotData); this.debug('plotData', plotData);
// wrap in additional array since flot can handle multiple graphs at once, we only need one // wrap in additional array since flot can handle multiple graphs at once, we only need one
const plot = $this.plot([plotData], this.get('options')).data('plot'); const plot = $this.plot([plotData], this.get('options')).data('plot');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment