diff --git a/app/components/line-chart.js b/app/components/line-chart.js index f2c9ff6..9de6b5c 100644 --- a/app/components/line-chart.js +++ b/app/components/line-chart.js @@ -11,6 +11,10 @@ export default Ember.Component.extend({ didInsertElement: function() { this._drawPlot(); + + Ember.run.later(this, function() { + this._drawPlot(); + }, 500); }, dataDidChange: function() { @@ -20,5 +24,9 @@ export default Ember.Component.extend({ _drawPlot: function() { var elementId = this.get('elementId'); $.plot('#' + elementId, this.data); + + Ember.run.later(this, function() { + this._drawPlot(); + }, 500); } }); diff --git a/app/routes/lab-mashup/entity/property.js b/app/routes/lab-mashup/entity/property.js index a01e1c6..3d1bf13 100644 --- a/app/routes/lab-mashup/entity/property.js +++ b/app/routes/lab-mashup/entity/property.js @@ -8,11 +8,5 @@ export default Ember.Route.extend({ var record = this.store.peekRecord('property', params.property_id); return record; - }, - - chartData: function() { - return { - name: 'test' - }; - }.property() + } }); diff --git a/app/templates/components/line-chart.hbs b/app/templates/components/line-chart.hbs index 8120e4e..e69de29 100644 --- a/app/templates/components/line-chart.hbs +++ b/app/templates/components/line-chart.hbs @@ -1,10 +0,0 @@ - diff --git a/app/templates/lab-mashup/entity/property.hbs b/app/templates/lab-mashup/entity/property.hbs index cc45aeb..134e322 100644 --- a/app/templates/lab-mashup/entity/property.hbs +++ b/app/templates/lab-mashup/entity/property.hbs @@ -1,12 +1 @@ -{{#if model.name}} -

Model: {{model.name}}, {{model.history.[0].length}}

-{{/if}} - -{{#if chartData}} -

{{chartData.name}}

-{{else}} -

No chart data

-{{/if}} - - {{line-chart data=model.history}}