Created
August 24, 2017 08:13
-
-
Save frcake/4746d54f17d2979527b24c1bc9185b52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
datapoints: [], | |
ipUpDownData: Ember.computed('datapoints', function() { | |
let controller = this; | |
var timestamp = []; | |
var ipup = []; | |
var ipdown = []; | |
timestamp.push('timestamp'); | |
ipup.push('ipup'); | |
ipdown.push('ipdown'); | |
// console.log(controller.get('datapoints').toArray()); | |
controller.get('datapoints').forEach(function(i) { | |
timestamp.push(i.get('timestamp')); | |
ipup.push(i.get('ipup')); | |
ipdown.push(i.get('ipdown')); | |
}); | |
let d = { | |
xs: { | |
'ipup': 'timestamp', | |
'ipdown': 'timestamp', | |
}, | |
columns: [ | |
timestamp, | |
ipup, | |
ipdown | |
], | |
type: 'spline', | |
types: { | |
ipdown: 'area-spline' | |
}, | |
colors: { | |
ipup: '#2d74d0', | |
ipdown: '#ff81be' | |
} | |
} | |
return d; | |
}), | |
point: { | |
show: false | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment