1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-16 00:00:03 +01:00
VILLASweb/app/components/line-chart.js

25 lines
449 B
JavaScript
Raw Normal View History

2015-10-09 09:22:35 +02:00
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'div',
2015-10-09 09:22:35 +02:00
classNames: ['line-chart'],
init: function() {
this._super();
this.addObserver('data', this.dataDidChange);
},
2015-10-09 09:22:35 +02:00
didInsertElement: function() {
this._drawPlot();
},
dataDidChange: function() {
this._drawPlot();
},
2015-10-09 09:22:35 +02:00
_drawPlot: function() {
var elementId = this.get('elementId');
$.plot('#' + elementId, this.data);
2015-10-09 09:22:35 +02:00
}
});