Skip to content

Commit

Permalink
Merge pull request apertureless#291 from apertureless/feature/fix_rea…
Browse files Browse the repository at this point in the history
…ctive_mixins

fix(mixins): Check for chartjs instance before rendering chart
  • Loading branch information
apertureless authored Jan 12, 2018
2 parents 0506b4e + 39ff839 commit 3b46bc8
Show file tree
Hide file tree
Showing 3 changed files with 552 additions and 484 deletions.
3 changes: 3 additions & 0 deletions src/mixins/reactiveData.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ module.exports = {
this.renderChart(this.chartData, this.options)
}
} else {
if (this.$data._chart) {
this.$data._chart.destroy()
}
this.renderChart(this.chartData, this.options)
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/mixins/reactiveProp.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ module.exports = {
this.renderChart(this.chartData, this.options)
}
} else {
if (this.$data._chart) {
this.$data._chart.destroy()
}
this.renderChart(this.chartData, this.options)
}
}
Expand Down
Loading

0 comments on commit 3b46bc8

Please sign in to comment.