1👍
✅
You should define your variable to hold the Chart
outside the mounted
function in order to be visible to the other methods.
So instead use this
let linechart;
export default {
name: "line-plot",
mounted() {
const ctx = document.getElementById("line-chart");
linechart = new Chart(ctx, this.chartData);
},
Source:stackexchange.com