2👍
Seems like a hovering issue with charts which is bringing back the data of old chart.
make myBarBothDaily
variable global and bind it with the context of template and initialise it with null before the Tracker.autorun()
block
this.myBarBothDaily = null
now inside autorun block, before instantiating your chart, destroy the data of previous chart by calling destroy()
function of chart.js.
if(this.myBarBothDaily) {
this.myBarBothDaily.destroy();
}
this.myBarBothDaily = new Chart(ctxtwo).Bar(data, options);
this should fix your issue.
- [Chartjs]-ChartJS place y-axis labels between ticks
- [Chartjs]-Why chart.js charts are not plotting data in Safari (works in Chrome)
Source:stackexchange.com