Skip to content
Snippets Groups Projects
Commit 4263c950 authored by Christoph Dornieden's avatar Christoph Dornieden
Browse files
parents 078e0b32 013e828e
Branches
No related tags found
No related merge requests found
......@@ -10,11 +10,10 @@ export default Component.extend({
timeSeries: [],
options: {
xaxis: {
mode: 'time',
mode: 'time'
// timezone: 'browser' // TODO: from Server?
},
yaxis: {
label: 'test'
}
},
height: 300,
......@@ -50,7 +49,9 @@ export default Component.extend({
// use Ember.get because it would work with Ember.Object and plain JS
const plotData = this.get('timeSeries.series')
.map((valueObj) => [get(valueObj, 'timestamp'), get(valueObj, 'value')]);
this.debug('plotData', plotData);
this.set('options.yaxis.axisLabel', this.get('timeSeries.valueLabel'));
// 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');
this.set('plot', plot);
......
......@@ -8,6 +8,7 @@
"visionmedia-debug": "2.2",
"webcola": "^3.1.3",
"bootstrap-sass": "^3.3.6",
"Flot": "flot#^0.8.3"
"Flot": "flot#^0.8.3",
"flot-axislabels": "https://github.com/markrcote/flot-axislabels.git"
}
}
......@@ -29,6 +29,7 @@ module.exports = function(defaults) {
app.import('bower_components/webcola/WebCola/cola.js');
app.import('bower_components/Flot/jquery.flot.js'); // time-series-plot component
app.import('bower_components/Flot/jquery.flot.time.js');
app.import('bower_components/flot-axislabels/jquery.flot.axislabels.js');
return app.toTree();
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment