Skip to content

Commit

Permalink
Merge pull request #39 from NoobSkywalker/master
Browse files Browse the repository at this point in the history
added general redraw option
  • Loading branch information
aomran committed Mar 12, 2016
2 parents 1106bc8 + e2dcfd9 commit 450de3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions addon/components/ember-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ export default Ember.Component.extend({
var data = this.get('data');
var type = Ember.String.classify(this.get('type'));
var options = Ember.merge({}, this.get('options'));

var redraw = this.get('redraw');
var chart = new Chart(context)[type](data, options);

if (this.get('legend')) {
var legend = chart.generateLegend();
this.$().wrap("<div class='chart-parent'></div>");
this.$().parent().append(legend);
}

this.set('redraw', redraw);
this.set('chart', chart);
this.addObserver('data', this, this.updateChart);
this.addObserver('data.[]', this, this.updateChart);
Expand All @@ -45,7 +45,7 @@ export default Ember.Component.extend({
chart: chart
}).updateByType();

if (redraw) {
if (this.get('redraw') || redraw) {
this.willDestroyElement();
this.didInsertElement();
} else {
Expand Down

0 comments on commit 450de3f

Please sign in to comment.