Skip to content

Commit

Permalink
fix(mixins): Check for chartjs instance before rendering chart
Browse files Browse the repository at this point in the history
Closes #288
  • Loading branch information
apertureless committed Jan 12, 2018
1 parent 0506b4e commit 39ff839
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 39ff839

Please sign in to comment.