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/static-chart.js

28 lines
574 B
JavaScript
Raw Normal View History

import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'div',
classNames: ['line-chart'],
attributeBindings: ['style'],
xaxisLength: 300,
height: '100%',
data: [],
options: {},
didInsertElement: function() {
this._drawPlot();
},
style: function() {
return "height: " + this.get('height') + ";";
}.property('height'),
_drawPlot: function() {
var element = this.get('element');
if (element && element.id) {
// draw plot
$.plot('#' + element.id, this.get('data'), this.get('options'));
}
}.observes('data')
});