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
Markus Grigull 15b4e05c5d Add button test
Add dataSet and options parameter to static-chart component
and switch data sets on button press.
2015-10-26 11:22:05 -04:00

27 lines
574 B
JavaScript

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')
});