import Ember from 'ember';

export default Ember.Component.extend({
  tagName: 'div',
  
  didInsertElement: function(){
    var data = this.get('data');
    var options = this.get('options');
    var graph = new Rickshaw.Graph( {
      element: this.element, 
      width: this.get("width"), 
      height: this.get("height"),
      renderer: this.get("type"),
      series: data
    });
    graph.render();
    this.set('graph', graph);
    this.addObserver('data', this, this.updateGraph);
    this.addObserver('data.[]', this, this.updateGraph);
    this.addObserver('options', this, this.updateGraph);
    
  },
  

});

@@ -79,19 +79,16 @@
  'div',%0A
-  %0A
   didIns
@@ -249,17 +249,16 @@
 element,
- 
 %0A      w
@@ -281,17 +281,16 @@
 width%22),
- 
 %0A      h
@@ -599,20 +599,69 @@
 h);%0A
+%0A
   
-  %0A  %7D,
+%7D,%0A  updateGraph()%7B%0A      this.get(%22graph%22).update();
 %0A  
+%7D%0A
 %0A%0A%7D)

update graph